Hi guys,
I am a newbie in Java & SQL. I am currently working on a WAP project using JSP & MySQL as the DBMS. My questions:
1. Java compiler: I saw in the manual we can use javac -sourcepath <dir> <file>. But when i tried to do that, it generates errors that says "Error: cannot read: filename.java". It works only when i place the .java file in the bin directory of the JDK and compile it with javac filename.java, it works! What is the problem? It is a real hassle everytime i need to copy those servlets to JDK bin's directory, compile and copy back to my development directory. For your information my JDK dir is in d:/fyp/JDK1.3.1 and my Tomcat development dir is in d:/fyp/Tomcat/webapps/Root/WEB-INF/classes. Can someone also explain what's the difference wbetween javac -sourcepath, javac -classpath and javac -d <dir>?
2. JDBC.
I am using mysql jdbc driver called 'org.gjt.mm.mysql.Driver' where it's .jar file was placed in the 'lib' directory in Tomcat. Please tell me if im correct. What is the easiest way to test that my JDBC driver works? How can I test it with a database that I have created in 'd:/mysql/data/projectdb' with the JDBC driver in Tomcat since BOTH of them are in different directories (JDBC in d:/fyp/Tomcat & MYSQL is in d:/mysql)?
3. Web.xml
do i need to tweak the VALUES in the lines in web.xml to make sure that my JDBC driver works?
........
<param-name>dbdriver</param-name>
<param-value>org.gjt.mm.mysql.Driver</param-value>
........
<param-name>database</param-name>
<param-value>jdbc:mysql://localhost/projectdb</param-value>
........
<param-name>dbuser</param-name>
<param-value>user</param-value>
........
<param-name>dbuserpwd</param-name>
<param-value>123456</param-value>
........
Please advice how can i make this -> jdbc:mysql://localhost/projectdb possible since Tomcat & MySQL is both in different directories?
Please help. I'm stuck.
Regards,
cyw


.newInstance();

