Link to home
Start Free TrialLog in
Avatar of jean ala
jean alaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

JDBC installation -please help

I have just started installing msql and I want to access it using JDBC.
I have tried to connect but I got class not found error and according to http://www.imaginary.com/Java/mSQL-JDBC/FAQ.html#install
it is a CLASSPATH problem. Can somebody help me with the installation before I get fed up and forget it.

What I have done is:
-download msql-JDBC from imaginary and put it under jdk1.1/lib
-the CLASSPATH, I am not really sure cause the above site uses unix
which I am not familiar with.

This is my CLASSPATH now
CLASSPATH=c:\jdk1.1.8\lib\msql-jdbc-1.zip:c:\jdk1.1.8\lib\classes.zip

Are there anything else needed ? or any mistakes ?


after compiling the and then run the test code in the above site and get  
"can't find class Select" error

I appreciate any help.

Jean
Avatar of slok
slok

I will assume u are working on windows
platform.

try changng the classpath to

CLASSPATH=c:\jdk1.1.8\lib\msql-jdbc-1.zip;c:\jdk1.1.8\lib\classes.zip

NOTE the ';' instead of ':' used.
Avatar of jean ala

ASKER

Yes I am working under windows 98 and NT.
How do you set the classpath in NT please.
Thanks
go to 'My Computer' on your desktop and right click on it.
select 'Properties'.

there should be a Environments tab.
click on it.

add your classpath.

alternatively, go to DOS prompt and type
set CLASSPATH=c:\jdk1.1.8\lib\msql-jdbc-1.zip;c:\jdk1.1.8\lib\classes.zip


if setting classpath still fails, see whether u have a 'ext' directory
in c:\jdk1.1.8\lib and copy the 2 zip files into that directory.

Ok I managed to set the classpath in the NT machine and set the classpath in the 98 one but I still gert the same error:
can't find class
>if setting classpath still fails, see whether u >have a 'ext' directory  in c:\jdk1.1.8\lib and copy >the 2 zip files into that directory.

Yes they are there both the
mSQL-JDBC-1.zip  and classes.zip under c:\jdk1.1.8\lib
"can't find class Select" error

I assume u have a Select.java
u need to include the path to Select.java in the classpath as well.
eg. if Select.java is in c:\projects then include
c:\projects in classpath

>I assume u have a Select.java
Of course I have the test program as mentioned in
http://www.imaginary.com/Java/mSQL-JDBC/FAQ.html#install 

and run it as described in the same site
java Select jdbc:msql://localhost:1114/test

test: the database name.

but nothing happend. Even if the database server is not running it does the same thing. It executes
and return to the C:\  prompt as follows:

C:\java Select jdbc:msql://localhost:1114/test
C:\

Is that correct  ?

and what's wrong ?

Thanks alot.
ASKER CERTIFIED SOLUTION
Avatar of dorothy2
dorothy2
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
For (3) - select.class is in examples.jar. So add that archive to your classpath as well. Don't worry about recompiling select.java.