aspose file tools
The moose likes JDBC and the fly likes connection URL for SQLServer2008 using JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "connection URL for SQLServer2008 using JDBC" Watch "connection URL for SQLServer2008 using JDBC" New topic
Author

connection URL for SQLServer2008 using JDBC

pintu shah
Greenhorn

Joined: Nov 12, 2010
Posts: 24
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

Joined: Dec 20, 2006
Posts: 2343

Is that a valid jdbc connection url?

http://msdn.microsoft.com/en-us/library/ms378428.aspx


OCUP UML fundamental
ITIL foundation
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: connection URL for SQLServer2008 using JDBC
 
Similar Threads
[Microsoft][ODBC Driver Manager] Invalid string or buffer length exception for 64 bit SQL Server
Problem with Connectivity
Exception during connecting to sql server2005
unable to connect to MS SQL server 2000
ClassNotFoundException