Showing posts with label classnotfoundexception. Show all posts
Showing posts with label classnotfoundexception. 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:

ClassNotFound

Dear all
I'm new on Java. Now I got a error in my program is
java.lang.ClassNotFoundException and the class is :
com.microsoft.jdbc.sqlserver.SQLServerDriver .
My classpath already contain that 3 JAR files
(msbase.jar,msutil.jar,mssqlserver.jar) and my servlet already included the
javax.sql.* and javax.naming.*. So now I don't know what i'm missing now.
anyone here can help me to solve this problem ? please give me some idea...
Thanks a lot !!
Ivan
This is definetly a classpath issue. Esle Open all jar and see if you can find the class you are looking for
|||Thx Neo,
I have found the problem now, the classpath I have been setting up before.
Actually the problem was I need to copy those JDBC JAR files to lib\
directory then it will be fine.
"neo" <anonymous@.discussions.microsoft.com> bl
news:538F8F46-32AA-4F42-A4EA-FC83131F384E@.microsoft.com g...
> This is definetly a classpath issue. Esle Open all jar and see if you can
find the class you are looking for