aspose file tools*
The moose likes JDBC and the fly likes exception while connecting sqlserver 2000 with java application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "exception while connecting sqlserver 2000 with java application" Watch "exception while connecting sqlserver 2000 with java application" New topic
Author

exception while connecting sqlserver 2000 with java application

pradeep singh
Ranch Hand

Joined: Oct 23, 2007
Posts: 339
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'


SCJP 5.0(75%), SCWCD 5.0(88%)
Anubhav Anand
Ranch Hand

Joined: May 18, 2007
Posts: 341

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

Joined: Dec 20, 2006
Posts: 2503
    
    8

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


OCUP UML fundamental and ITIL foundation
youtube channel
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Why are you creating anything in the master database?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Baseet Ahmed
Ranch Hand

Joined: Dec 18, 2006
Posts: 224
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."
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: exception while connecting sqlserver 2000 with java application