|
Home > Archive > SQL Server JDBC > January 2006 > SQL Server 2005 JDBC Driver. Old jars in classpath?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
SQL Server 2005 JDBC Driver. Old jars in classpath?
|
|
| Richard 2006-01-20, 11:23 am |
| I am want to use the 2005 driver to connect to a SQL Server 2000 database.
Currenlty, I can not connect to my 2000 database with the sqljdbc.jar. I
am using the new driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver
I keep getting the message "No suitable driver" from the SQL Exception.
This occurs when only the sqljdbc.jar file is in my classpath.
Then when I add msbase.jar; msutil.jar, and mssqlserver.jar to my classpath,
then my program will connnect.
I can not find any documentation, in the 2005 jdbc driver, that state that
these files are not required.
| |
| Joe Weinstein 2006-01-20, 11:23 am |
|
Richard wrote:
> I am want to use the 2005 driver to connect to a SQL Server 2000 database.
>
> Currenlty, I can not connect to my 2000 database with the sqljdbc.jar. I
> am using the new driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver
>
> I keep getting the message "No suitable driver" from the SQL Exception.
> This occurs when only the sqljdbc.jar file is in my classpath.
>
> Then when I add msbase.jar; msutil.jar, and mssqlserver.jar to my classpath,
> then my program will connnect.
>
> I can not find any documentation, in the 2005 jdbc driver, that state that
> these files are not required.
Hi. You need to change your *URL* and driver class name to the new
driver and it's form of URL. eg:
Properties props = new Properties();
Driver d = new com.microsoft.sqlserver.jdbc.SQLServerDriver();
props.put("user", "joe");
props.put("password", "joe");
Connection c = d.connect("jdbc:sqlserver://joemachine:1433", props );
HTH,
Joe Weinstein at BEA Systems
| |
| Richard 2006-01-20, 8:23 pm |
| Per my originall message, I am using the
com.microsoft.sqlserver.jdbc.SQLServerDriver classe. This is the new one.
Also, I am using the new URL format jdbc:sqlserver://myserver:1433....
My simple java class is just testing a connection to SQL Server 2000
database.
"Joe Weinstein" wrote:
>
>
> Richard wrote:
>
>
> Hi. You need to change your *URL* and driver class name to the new
> driver and it's form of URL. eg:
>
> Properties props = new Properties();
> Driver d = new com.microsoft.sqlserver.jdbc.SQLServerDriver();
>
> props.put("user", "joe");
> props.put("password", "joe");
>
> Connection c = d.connect("jdbc:sqlserver://joemachine:1433", props );
>
>
> HTH,
> Joe Weinstein at BEA Systems
>
>
| |
| Rajavelu 2006-01-24, 3:23 am |
| I got my connection working with the SQLServerDataSource class of SQL Server
2005 JDBC Driver. You can also try the following code;
SQLServerDataSource dataSource = new SQLServerDataSource(
);
dataSource.setServerName("joemachine");
dataSource. setPortNumber(1433);
dataSource.setDatabaseName("Your_DB");
dataSource.setUser("joe");
dataSource.setPassword("joe");
Connection connection = dataSource.getConnection();
System.out.println("Connected !!!");
Regards,
Rajavelu.
"Richard" wrote:
[color=darkred]
> Per my originall message, I am using the
> com.microsoft.sqlserver.jdbc.SQLServerDriver classe. This is the new one.
> Also, I am using the new URL format jdbc:sqlserver://myserver:1433....
>
> My simple java class is just testing a connection to SQL Server 2000
> database.
>
> "Joe Weinstein" wrote:
>
| |
| Evan T. Basalik 2006-01-24, 11:23 am |
| Richard,
Your CLASSPATH should be of the form: ". ;C:\msjdbc\MSJDBC200
5\sqljdbc.jar". You shouldn't need the other CLASSPATH references.
Could you please post your code?
Evan
--------------------
>Thread-Topic: SQL Server 2005 JDBC Driver. Old jars in classpath?
>thread-index: AcYgxa2wDkAQ74d5S8+Q
f3gwUcvdUw==
>X-WBNR-Posting-Host: 15.219.201.70
>From: "=?Utf-8?B?UmFqYXZlbHU=?=" < Rajavelu@discussions
.microsoft.com>
>Subject: Re: SQL Server 2005 JDBC Driver. Old jars in classpath?
>Date: Tue, 24 Jan 2006 01:08:02 -0800
>Lines: 60
>Message-ID: <A53570AE-C284-487B-93CD- 6C657F2C384A@microso
ft.com>
>I got my connection working with the SQLServerDataSource class of SQL Server
>2005 JDBC Driver. You can also try the following code;
>
> SQLServerDataSourc
e dataSource = new SQLServerDataSource(
);
> dataSource.setServerName("joemachine");
> dataSource. setPortNumber(1433);
> dataSource.setDatabaseName("Your_DB");
> dataSource.setUser("joe");
> dataSource.setPassword("joe");
> Connection connection = dataSource.getConnection();
> System.out.println("Connected !!!");
>
>Regards,
>Rajavelu.
>
>"Richard" wrote:
>
>
--
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.
|
|
|
|
|