File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Cannot open database " requested by the login. The login failed." title="" /> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Cannot open database "<dbname>" requested by the login. The login failed." Watch "Cannot open database "<dbname>" requested by the login. The login failed." New topic
Author

Cannot open database "<dbname>" requested by the login. The login failed.

forums UseR
Ranch Hand

Joined: Feb 24, 2009
Posts: 169
Hello,

I am struggling to find the reason for ClassNotFoundException at the line :





The class path already has sqljdbc.jar which includes the class "com.microsoft.sqlserver.jdbc.SQLServerDriver"

Can any body tell me how to fix this.

Thanks

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60992
    
  65

"seenuFour cnu", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38349
    
  23
Please read your private messages again.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38349
    
  23
Oh, I didn't realise you had warned him so recently, Bear. Sorry.
forums UseR
Ranch Hand

Joined: Feb 24, 2009
Posts: 169
Is anybody out there who can help me resolve this....
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3825

srinivas mc wrote:Can any body tell me how to fix this.


Can you post the stack trace here?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41500
    
  53
What is your classpath? Can you verify that it doesn't contain a typo?


Ping & DNS - my free Android networking tools app
forums UseR
Ranch Hand

Joined: Feb 24, 2009
Posts: 169
Thanks for your replies guys ,

I am getting a different SQL Exception now.



The userID/pwd work fine, as am able to login using SQL Express interface.


Is this a database admin issue ?

Thanks

Srinivas
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2495
    
    8

How comes you get a different error now? Did you change something?

The userID/pwd work fine, as am able to login using SQL Express interface.


Is this a database admin issue ?
Probably.

Do you try to use NT security to connect to the database?
Ff yes, first try if you can connect to the database using SqlServer security.

OCUP UML fundamental and ITIL foundation
youtube channel
forums UseR
Ranch Hand

Joined: Feb 24, 2009
Posts: 169
Was using a wrong database name.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot open database "<dbname>" requested by the login. The login failed.