I'm running Win/2003 Server, SQL Server 2000, and Sun Java 1.5.
MS article # 3323200 "How to get started with ms jdbc" says I need to set
the CLASSPATH variable to point to my jdbc.jar file location.
Where do I go to make this setting. Apparently it is not set like the PATH
variable.
Thanks
Jim Shaw wrote:
> I'm running Win/2003 Server, SQL Server 2000, and Sun Java 1.5.
> MS article # 3323200 "How to get started with ms jdbc" says I need
to set
> the CLASSPATH variable to point to my jdbc.jar file location.
> Where do I go to make this setting. Apparently it is not set like
the PATH
> variable.
You have to add the driver jar (or jars, in the case of the MS driver
-- msutil.jar, mssqlserver.jar, msbase.jar) to the CLASSPATH system
variable. It's exactly the same as setting the PATH system variable
(the only difference might be that the CLASSPATH variable is not yet
defined, so you should add it).
I would also recommend jTDS ( http://jtds.sourceforge.net/ ) instead of
the MS driver. But that's just my oppinion.
Alin,
The jTDS Project.
|||Thanks Alin.
I initally tried to use jtds. I like its features a lot. I even joined
sourceforge and downloaded jtds, but I could not find any documentation on
how to install and use it. I'm an experienced programmer, but new to both
SQL Server and the Java language. I'm in the process of self teaching them
to myself, so I need some simple documentation to get started. I'm finding
that at MS, so I downloaded their driver for starters. Does jtds have such
documentation, or must I complete my Java learnings and then read the jtds
source code to figure out how to use it?
Jim
"Alin Sinpalean" <alin@.earthling.net> wrote in message
news:1107866811.028206.24460@.g14g2000cwa.googlegro ups.com...
> Jim Shaw wrote:
> to set
> the PATH
> You have to add the driver jar (or jars, in the case of the MS driver
> -- msutil.jar, mssqlserver.jar, msbase.jar) to the CLASSPATH system
> variable. It's exactly the same as setting the PATH system variable
> (the only difference might be that the CLASSPATH variable is not yet
> defined, so you should add it).
> I would also recommend jTDS ( http://jtds.sourceforge.net/ ) instead of
> the MS driver. But that's just my oppinion.
> Alin,
> The jTDS Project.
>
|||Jim Shaw wrote:
> Does jtds have such
> documentation, or must I complete my Java learnings and then read the
jtds
> source code to figure out how to use it?
jTDS has all the documentation you need to get started with it (both
online and in the distribution package -- the web site contents are
part of the distribution). There are also README files for each feature
that needs special configuration/installation, such as SSL, Windows
Single Sign On or XA distributed transactions. Start with the FAQ:
http://jtds.sourceforge.net/faq.html
Alin.
Showing posts with label jdbc. Show all posts
Showing posts with label jdbc. Show all posts
Thursday, March 22, 2012
ClassNotFoundException
Hi all,
I am new to java. I have installed SQL Server JDBC Driver SP3 on my
computer.
When I run the statement Class.forName("..."); , I get the
ClassNotFoundException.
I have read the following article
http://support.microsoft.com/default...;en-us;313100.
And I am sure that I have my CLASSPATH variable is like the following:
CLASSPATH=.;c:\program files\Microsoft SQL Server 2000 Driver for
JDBC\lib\msbase.jar;c:\program files\Microsoft SQL Server 2000 Driver for
JDBC\lib\msutil.jar;c:\program files\Microsoft SQL Server 2000 Driver for
JDBC\lib\mssqlserver.jar
But the exception still occurs. Even when I copied the 3 jar files into
c:\j2sdk\lib, it also didn't work.
Anyone can help me?
Thank you!
Hi Charlie,
Are you sure that the driver classes are accesible from your calling class,
ie, have you imported the driver package?
Ian
"Charlie Tong" wrote:
> Hi all,
> I am new to java. I have installed SQL Server JDBC Driver SP3 on my
> computer.
> When I run the statement Class.forName("..."); , I get the
> ClassNotFoundException.
> I have read the following article
> http://support.microsoft.com/default...;en-us;313100.
> And I am sure that I have my CLASSPATH variable is like the following:
> CLASSPATH=.;c:\program files\Microsoft SQL Server 2000 Driver for
> JDBC\lib\msbase.jar;c:\program files\Microsoft SQL Server 2000 Driver for
> JDBC\lib\msutil.jar;c:\program files\Microsoft SQL Server 2000 Driver for
> JDBC\lib\mssqlserver.jar
> But the exception still occurs. Even when I copied the 3 jar files into
> c:\j2sdk\lib, it also didn't work.
> Anyone can help me?
> Thank you!
>
>
|||It works now.
Thanks Ian!
"Ian555" <Ian555@.discussions.microsoft.com> wrote in message
news:CFED38BD-C33C-4336-97E3-624D5C5513DD@.microsoft.com...[vbcol=seagreen]
> Hi Charlie,
> Are you sure that the driver classes are accesible from your calling
> class,
> ie, have you imported the driver package?
> Ian
> "Charlie Tong" wrote:
I am new to java. I have installed SQL Server JDBC Driver SP3 on my
computer.
When I run the statement Class.forName("..."); , I get the
ClassNotFoundException.
I have read the following article
http://support.microsoft.com/default...;en-us;313100.
And I am sure that I have my CLASSPATH variable is like the following:
CLASSPATH=.;c:\program files\Microsoft SQL Server 2000 Driver for
JDBC\lib\msbase.jar;c:\program files\Microsoft SQL Server 2000 Driver for
JDBC\lib\msutil.jar;c:\program files\Microsoft SQL Server 2000 Driver for
JDBC\lib\mssqlserver.jar
But the exception still occurs. Even when I copied the 3 jar files into
c:\j2sdk\lib, it also didn't work.
Anyone can help me?
Thank you!
Hi Charlie,
Are you sure that the driver classes are accesible from your calling class,
ie, have you imported the driver package?
Ian
"Charlie Tong" wrote:
> Hi all,
> I am new to java. I have installed SQL Server JDBC Driver SP3 on my
> computer.
> When I run the statement Class.forName("..."); , I get the
> ClassNotFoundException.
> I have read the following article
> http://support.microsoft.com/default...;en-us;313100.
> And I am sure that I have my CLASSPATH variable is like the following:
> CLASSPATH=.;c:\program files\Microsoft SQL Server 2000 Driver for
> JDBC\lib\msbase.jar;c:\program files\Microsoft SQL Server 2000 Driver for
> JDBC\lib\msutil.jar;c:\program files\Microsoft SQL Server 2000 Driver for
> JDBC\lib\mssqlserver.jar
> But the exception still occurs. Even when I copied the 3 jar files into
> c:\j2sdk\lib, it also didn't work.
> Anyone can help me?
> Thank you!
>
>
|||It works now.
Thanks Ian!
"Ian555" <Ian555@.discussions.microsoft.com> wrote in message
news:CFED38BD-C33C-4336-97E3-624D5C5513DD@.microsoft.com...[vbcol=seagreen]
> Hi Charlie,
> Are you sure that the driver classes are accesible from your calling
> class,
> ie, have you imported the driver package?
> Ian
> "Charlie Tong" wrote:
Subscribe to:
Posts (Atom)