3 messages in com.mysql.lists.javamm.mysql windows setup question| From | Sent On | Attachments |
|---|---|---|
| Nathan Murray | 22 Apr 2002 08:27 | |
| Alec...@Quantel.Com | 22 Apr 2002 09:01 | |
| Robert I Graham | 22 Apr 2002 09:03 |
| Subject: | mm.mysql windows setup question![]() |
|---|---|
| From: | Robert I Graham (Robe...@ee.ed.ac.uk) |
| Date: | 04/22/2002 09:03:35 AM |
| List: | com.mysql.lists.java |
Hi Nathan,
I just joined this list, so forgive me if this is a common question. I have
to connect Java code to a Mysql database for a class project. I am running Windows 98.
I have downloaded the mm.mysql driver, but trying to connect to mysql from
java code still doesn't work. Mysql works fine, I can create databases and tables. Java works well enough to at least run a "Hello World" program. Right now I am just using the DOS window, I will be using JBuilder personal edition 6 once I get started.
My problems are that I'm not sure if I un-jarred the mm.mysql correctly or
where to put it. What I would like to know is how to configure it and how to unjar. This was the first time I had to use the "jar" command and I'm not sure if I did it right.
==================================================
The file that you downloaded from sourceforge will be called mm.mysql-2.0.12-you-must-unjar-me.jar
To unjar this file, use the following command: jar -xvf mm.mysql-2.0.12-you-must-unjar-me.jar
This assumes that you have set your JDK in your path. Alternatively, if you have powerarchiver available, you can use this to extract the files. Once extracted, you should have a directory called mm.mysql-2.0.12. In this directory you should find another jar file called mm.mysql-2.0.12-bin.jar. This jar file represents the driver to the database. You need to place this file into your CLASSPATH environmental variable. In windows 98/dos use the set command to see if CLASSPATH has already been set. If so, simply add the full path to mm.mysql-2.0.12-bin.jar to the CLASSPATH. Not entirely sure how to do this in windows 98 but it is probably something like adding the following line to your C:\autoexe.bat file followed by a reboot...
set CLASSPATH=CLASSPATH;C:\mm.mysql-2.0.12-bin.jar
Note: you can place the jar file in any location you like. It doesn't have to be in the root directory.
Your java applications should now see the driver. In JBuilder you will need to define the driver as an external library using Tools|Configure Libraries menu option and then add it to the current project.
Robert.




