path question
From: Yamin (absdfsd_at_sdfdasfsd.com)
Date: 03/06/04
- Previous message: Mladen Adamovic: "Re: hsqldb - trying to run inside Tomcat"
- Next in thread: Markku: "Re: path question"
- Reply: Markku: "Re: path question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 6 Mar 2004 01:59:24 -0500
Hi all,
I'm just started off with databases and jdbc. I've gotten some samples
going, but I just want to know if theres any 'recommended' style of
including jdbc drivers.
Currently, I'm useing mysql as the database server
I downloaded the jdbc drivers from mysql
(mysql-connector-java-3.0.11-stable-bin.jar)
In my Main.java file, I load the driver by:
Class.forName("com.mysql.jdbc.Driver").newInstance();
so, now the bulk of the question is where/how do I include the actual jdbc
driver. The instructions that came with the driver gave too many options.
1. copy the com/org directories to some dir and include them in the java
Classpath
2. copy the jar file to the /ext folder of the java runtine
3. copy the jar file to the local dir and place it in the Classpath
For the classpath as well, there are further options.
1. set the environment variable CLASSPATH
2. simply set the classpath for the java commandline tools. java -cp
<jarfile> Main
What I'm doing right now is just copying the jar file to my local project
dir, and adding it to the command line path
java -cp ".;mysqljdbc.jar" Main
I also had it working with setting the CLASSPATH environment variable. I
never quite got it to work by just copying it to the /ext folder. I'm on
windows XP, with jre 1.4 if that's any help on that one.
I've also been kinda working in NetBean IDE for a bit as well. Just for the
hell of it. In there, they just ignore all class paths and ask you to mount
folders and what not.
Any advice here ?
Thanks
Yamin
- Previous message: Mladen Adamovic: "Re: hsqldb - trying to run inside Tomcat"
- Next in thread: Markku: "Re: path question"
- Reply: Markku: "Re: path question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|