I downloaded the Development version of the MySQL. Nonetheless, it should work for you.
1. download the Connector/J (mysql-connector-java-3.1.0-alpha.zip).
Unzip the outer file into your root directory (C:\).
2. at the very beginning, type:
C:\> C:\mysql\bin\mysqld-nt --standalone
to start mysql server
3. and when you make changes
you should compile
java files again
4. Using the JDBC Driver
In order to use the JDBC driver, you just need
to put it on your classpath, OR installing it
as a Java extension library.
4.1. to put it on the classpath:
WINDOWS:
set classpath=.;C:\mysql-connector-java-3.1.0-alpha\mysql-connector-java-3.1.0-alpha-bin.jar;%classpath%
(of course, you'll need to change the folders to the folder you put the JAR into)
4.2. if you put it in your jre/lib/ext folder of your JDK/JRE, the JDBC Driver will also be found automatically.
4.3. alternatively, run the program this way:
java -classpath C:\mysql-connector-java-3.1.0-alpha\mysql-connector-java-3.1.0-alpha-bin.jar; TestServlet localhost
test where TestServlet is the name of the Java program and test is the name of the database.
4.3. The driver is mysql-connector-java-3.1.0-alpha-bin.jar, placed it in
C:\jakarta-tomcat-4.1.18-LE-jdk14\common\lib directory
5. prepare the web.xml file for running Servlets
6. Compile the test program:
javac -d C:\jakarta-tomcat-4.1.18-LE-jdk14/webapps/ROOT/WEB-INF/classes TestServlet.java
7. Run it by the following command:
start the Tomcat and
http://localhost:8080/servlet/TestServlet Here is the code for the TestServlet.java
[ April 09, 2003: Message edited by: JiaPei Jen ]
[ April 09, 2003: Message edited by: JiaPei Jen ]
[ April 09, 2003: Message edited by: JiaPei Jen ]