Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exception while connecting sqlserver 2000 with java application

 
pradeep singh
Ranch Hand
Posts: 339
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody

Please anybody solve my this problem.I am connection my standalone application through sqlserver2000.Code is compile fine but at run time i got error .I create the table 'accounts' in master database .I run query successfuly and got the result fine in sql analyzer but error when i try to get the data through application.
error is:

exception generated java.sql.SQLException:[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'accounts'
 
Anubhav Anand
Ranch Hand
Posts: 341
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, this looks if you have some problem with SQL driver or the user you are using to get the data doesn't have enough credentials. Check the permisssions for the user you are using in the code and, if he has atleast read access.
 
Jan Cumps
Bartender
Posts: 2599
12
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using the same username to log in the analyzer and in your JDBC connection?
Can you try to put the schema name in front of the table name (master.accounts)?

Regards, Jan
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you creating anything in the master database?
 
Baseet Ahmed
Ranch Hand
Posts: 225
Java Notepad Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can you paste your jdbc java code for the same for understanding the problem more clearly ?



Regards
Baseet Ahmed

Request to ALL:
"Do worship The Creator,not the creation."
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic