This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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: 63034
    
  69

"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: 43282
    
  32
Please read your private messages again.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 43282
    
  32
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: 3886
    
    5

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
Rancher

Joined: Mar 22, 2005
Posts: 42956
    
  73
What is your classpath? Can you verify that it doesn't contain a typo?
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: 2541
    
  10

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
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.
 
It's not a secret anymore!