JDBC Connectivity SQL SERVER 2005 Fails

I'm trying conect to my local SQL SERVER EXPRESS 2005 I'm using the JDBC DRIVER SQL SERVER 2005 1.1 (DBVisualizer and Java Code) with the following conecction data:

url=jdbc:sqlserver://127.0.0.1\SQLEXPRESS:1433;SelectMethod=cursor;databaseName=MiExamenOnline
username=vision
password=vision

When i trying the connection in Microsoft SQL Server Management Studio Express it's correct !!!

The error in java code and  DBVisualizer is:

An error occurred while establishing the connection:
   Type: com.microsoft.sqlserver.jdbc.SQLServerException   Error Code: 4060   SQL State: S0001
Message:
   Cannot open database "MiExamenOnline" requested by the login. The login failed.
vcaravantes2008Asked:
Who is Participating?
 
gandalf2041Connect With a Mentor Commented:
SOLUTION:  I found the solution on MSDN.  Change the connection string as follows:

jdbc:sqlserver://localhost;instanceName=SQLEXPRESS;integratedSecurity=true:1433;databaseName=MiExamenOnline

Look here for further information: http://msdn.microsoft.com/en-us/library/ms378428(SQL.90).aspx

Hope this helps
0
 
MohammedUCommented:
As per the message, it is login failure issue...
It could be incorrect password or login doesn't have the access to default database...
Try connectiong through ssms and make sure you connect to the database and able to run th queries...
0
 
vcaravantes2008Author Commented:
The SQL Server Connection in Management Studio (Enterprise Manager) is correct with this user and password (vision,vision)

0
 
gandalf2041Commented:
I'm having the exact same issue.  I notice that you're using an instance name as well.  Could that have something to do with it??
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.