December 6, 2011 at 4:31 am
Hi All,
I am using SQL Server Management Studio Express, and i am getting weired output when i execute the query..
In java console i am getting the current count of number of records inserted in SQL DB, But when i execute the query in DB, it showing different counts for No of record inserted.
Eg. In java console i am getting as : Total Number of Records Inserted: 71730
But in SQL DB i am getting 68766 for first time..
and when i delete all rows and execute for the second time, i am getting different count like 67077..
Pls somebody help on this ???
December 6, 2011 at 4:38 am
Are you sure you are pointing to right Server & Database. Please verify your database connection in Java Console.
Easy test (assuming DEV environment): Delete all rows from Table (DB Connection) and query from Java Console. If you get any rows, you are certainly hitting wrong database.
December 6, 2011 at 4:44 am
Hi,
I am using correct server and DB connections only...
How to check that we are using Correct DB connections and DB server.
Thanks
December 6, 2011 at 4:48 am
First Try to fetch single Records from java console
and execute the same in the DB..
See ur getting the same results or not...
Then we will check with the Db Connections and which database ur using......
December 6, 2011 at 4:53 am
Hi,
Yes , i am getting the same result in both Java console and DB..
But if the record goes larger i am not getting the correct results while Updating the values in SQL DB.
December 6, 2011 at 4:55 am
ns22boss (12/6/2011)
Hi,I am using correct server and DB connections only...
How to check that we are using Correct DB connections and DB server.
Thanks
Please post your Java Connection String here.
December 6, 2011 at 4:57 am
Here is the connection details
Connection con = new Connection();
con.setDbHost("10.60.1.50");
con.setDriverName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
con.setDbName("QATESTDB");
con.setDbUser("sa");
con.setDbPassword("pa$$word");
con.setDbPort(1433);
con.setConnString(ConnectionAction.formConnectionString(con
.getDriverName(), con.getDbHost() + ":" + con.getDbPort(),
con.getDbName()));
ConnectionDetails conAlias = new ConnectionDetails(con
.getDriverName(), con.getConnString(), con.getDbUser(), con
.getDbPassword());
return conAlias;
December 6, 2011 at 4:59 am
ns22boss (12/6/2011)
Hi,How to check that we are using Correct DB connections and DB server.
Thanks
1. Verify your connection string properties for Java Console again.
OR
2. In the above post, Dev has already given you the idea to delete all the data in the target table (if it a test server & don't forget to make a backup of that table prior doing this ). Then check from Java Console, if you still get the data there, you are absolutely connecting to wrong server.
OR
3. If you don't want to delete the data, insert one dummy record in target table & check from Java console. If you get this dummy record there, you are pointing to correct server otherwise not.
December 6, 2011 at 5:03 am
ns22boss (12/6/2011)
Here is the connection detailsConnection con = new Connection();
con.setDbHost("10.60.1.50");
con.setDriverName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
con.setDbName("QATESTDB");
con.setDbUser("sa");
con.setDbPassword("pa$$word");
con.setDbPort(1433);
con.setConnString(ConnectionAction.formConnectionString(con
.getDriverName(), con.getDbHost() + ":" + con.getDbPort(),
con.getDbName()));
ConnectionDetails conAlias = new ConnectionDetails(con
.getDriverName(), con.getConnString(), con.getDbUser(), con
.getDbPassword());
return conAlias;
Please verify the bold items.
December 6, 2011 at 5:04 am
ns22boss (12/6/2011)
Here is the connection detailsConnection con = new Connection();
con.setDbHost("10.60.1.50");
con.setDriverName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
con.setDbName("QATESTDB");
con.setDbUser("sa");
con.setDbPassword("pa$$word");
con.setDbPort(1433);
con.setConnString(ConnectionAction.formConnectionString(con
.getDriverName(), con.getDbHost() + ":" + con.getDbPort(),
con.getDbName()));
ConnectionDetails conAlias = new ConnectionDetails(con
.getDriverName(), con.getConnString(), con.getDbUser(), con
.getDbPassword());
return conAlias;
You should never post the login credentials on this/any forum. I hope the password you provided here is not the actual one or is it :w00t:?Also, you should never use 'sa' to connect to application even if it is a test server.
December 6, 2011 at 5:12 am
Hi All,
Everything what you all said above, i did it and still i am getting different value only...
Is it related to performance Tuning and Data overloaded error ???
December 6, 2011 at 5:16 am
Is it related to performance Tuning and Data overloaded error ???
It comes at last, when you are certain that you are pointing to right database & server.
One thing for sure, if you are getting different results from your Java Console & DB Connection you are certainly not on same Database / Server.
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply