aspose 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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 60046
    
  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: 36453
    
  15
Please read your private messages again.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36453
    
  15
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: 3775

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: 39537
    
  27
What is your classpath? Can you verify that it doesn't contain a typo?


Ping & DNS - updated with new look and Ping home screen widget
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: 2476
    
    7

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.
 
Similar Threads
No Suitable Driver Error
JDBC query working. Servlet with same code throwing NullPointerException
No suitable driver found
Not able to connect to Mysql through servlet
No suitable driver found for JDBC