• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

connection URL for SQLServer2008 using JDBC

 
pintu shah
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Java 1.6 and SQL Server 2008 for this. I am using windows authentication to connect to MSSQL Server 2008 and windows authentication does not require any username and password.

I have used the following connection URL

private static final String CONNECTION_URL = "Driver={SQL Server Native Client 10.0.1600};Server=http://localhost:1433;Database=DataBases";

Connection conn = DriverManager.getConnection( CONNECTION_URL )

when i run the code I get following exception database is getting loaded though..

Exception in thread "main" java.sql.SQLException: No suitable driver found for Driver={SQL Server Native Client 10.0.1600};Server=http://localhost:1433;Database=DataBases
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at JDBC.TestDatabaseMetadata.main(TestDatabaseMetadata.java:16)
 
Jan Cumps
Bartender
Posts: 2602
13
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is that a valid jdbc connection url?

http://msdn.microsoft.com/en-us/library/ms378428.aspx
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic