JDBC CLASSPATH Not Working
Posted
by
AeroDroid
on Server Fault
See other posts from Server Fault
or by AeroDroid
Published on 2011-01-18T03:47:23Z
Indexed on
2011/01/18
3:54 UTC
Read the original article
Hit count: 251
I'm setting up a simple JDBC connection to my working MySQL database on my server. I'm using the Connector-J provided by MySQL. According to their documentation, I'm suppose to create the CLASSPATH variable to point to the directory where the mysql-connector-java-5.0.8-bin.jar is located. I used export set CLASSPATH=/path/mysql-connector-java-5.0.8-bin.jar:$CLASSPATH. When I type echo $CLASSPATH to see if it exists, everything seems fine. But then when I open a new terminal and type echo $CLASSPATH it's no longer there. I think this is the main reason why my Java server won't connect to the JDBC, because it isn't saving the CLASSPATH variable I set.
Anyone got suggestions or fixes on how to set up JDBC in the first place?
© Server Fault or respective owner