I am trying to establish communication with a mySQL database from a maplet provided over the Internet.
It's my understanding that the classpath for the JDBC must reside on the same filesystem as the maplet.
When I test my maplet on any of my computers (all Windows) I have not problem. Because I know exactly where the JAR file is located the following LoadDriver command works:
JDBC_MySQLdriver:=LoadDriver('driver'="com.mysql.jdbc.Driver",
'classpath' = "C:\\Documents and Settings/Doug/Desktop/mysql-connector-java-5.1.13-bin.jar");
But, if I put this maplet on one of my websites for others to download, then this path will be meaningless for other users - and even if the path were somehow valid, there is no guarantee they have the right JAR file in this location.
If I serve the maplet with my MapleNet server, then I am (in principle) back in the first case. I can put the JAR file almost anywhere on the MapleNet server. A natural place seems to be in /root/maplenet/jar/. This would mean the following should work:
JDBC_MySQLdriver:=LoadDriver('driver'="com.mysql.jdbc.Driver",
'classpath' = "/root/maplenet/jar/mysql-connector-java-5.1.13-bin.jar");
Alas, this is not successful, complaining that the driver com.mysql.jdbc.Driver cannot be found. In case it matters, the MapleNet server is running under Linux and the other setups are different varieties of Windows.
Can anyone give me some pointers on how to make this work? In particular,
- is it possible to allow users to use a remotely served JAR file?
Maybe with a reference to the file given along the lines of
'classpath'="http://maple.math.sc.edu:80/maplenet/jar/mysql-connector-java-5.1.13-bin.jar"
- What is the correct syntax to specify the classpath on a Linux system that includes a MapleNet server?
- Can I put the JAR file in the CLASSPATH environment variable on the MapleNet server (in /etc/profile)?