Re: SQL Server 2005 JDBC Driver. Old jars in classpath?
- From: evanba@xxxxxxxxxxxxxxxxxxxx (Evan T. Basalik (MSFT))
- Date: Tue, 24 Jan 2006 15:54:13 GMT
Richard,
Your CLASSPATH should be of the form: ".;C:\msjdbc\MSJDBC2005\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+Qf3gwUcvdUw==
>X-WBNR-Posting-Host: 15.219.201.70
>From: "=?Utf-8?B?UmFqYXZlbHU=?=" <Rajavelu@xxxxxxxxxxxxxxxxxxxxxxxxx>
>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@xxxxxxxxxxxxx>
>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:
>
>> 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:
>> >
>> > > 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
>> >
>> >
>
--
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.
.
- References:
- Re: SQL Server 2005 JDBC Driver. Old jars in classpath?
- From: Joe Weinstein
- Re: SQL Server 2005 JDBC Driver. Old jars in classpath?
- Prev by Date: Re: Behavior of Connection.commit()
- Next by Date: Microsoft SQL Server 2005 JDBC Driver is released to the web -- JAN 18, 2005
- Previous by thread: Re: SQL Server 2005 JDBC Driver. Old jars in classpath?
- Next by thread: Re: New JDBC Driver 1/19/06 & SSL ?
- Index(es):
Relevant Pages
|