help_me
asked on
Applet will not connect to msql database from Netscape
My applet will not connect to the msql database on the same server, it trips up on the last line of this section of code:
Class.forName("com.imagina ry.sql.msq l.MsqlDriv er");
String url = "jdbc:msql://firth.natcorp .ox.ac.uk: 1114/linkm ain";
Connection myConnection = DriverManager.getConnectio n(url,""," ");
Configuration used:
Symantec Visual Cafe Pro 1.0e
Netscape Communicator v4.0.3
Imaginary mSQL driver - the driver directory 'com.imaginary.sql.msql.Ms qlDriver' is in the same place as the applet
and the driver classpath has been appended to the project directories in Visual Cafe Pro
msql.acl has been set for database to accept remote access
Compiler when running the applet will not make a connection to the database either, but I'm more concerned with it not working from Netscape.
Thanks in advance for your help on this
Mel
Class.forName("com.imagina
String url = "jdbc:msql://firth.natcorp
Connection myConnection = DriverManager.getConnectio
Configuration used:
Symantec Visual Cafe Pro 1.0e
Netscape Communicator v4.0.3
Imaginary mSQL driver - the driver directory 'com.imaginary.sql.msql.Ms
and the driver classpath has been appended to the project directories in Visual Cafe Pro
msql.acl has been set for database to accept remote access
Compiler when running the applet will not make a connection to the database either, but I'm more concerned with it not working from Netscape.
Thanks in advance for your help on this
Mel
For multiple classes to be accessed from the browser you need to Jar them up (For netscape) and CAB them for (IE) .
jar cvf jar_name.jar *.class
will take all classes in that directory and create a jar file .
now in the HTML file you will have to make a change to the APPLET tag by adding ARCHIVE="jar_name.jar" .
jar cvf jar_name.jar *.class
will take all classes in that directory and create a jar file .
now in the HTML file you will have to make a change to the APPLET tag by adding ARCHIVE="jar_name.jar" .
ASKER
I will try Jarring the classes, where exactly do I put this line of code, is it an import
jar cvf jar_name.jar *.class
How do I create a java archive?
Please let me know how to do this and then I can do further tests.
jar cvf jar_name.jar *.class
How do I create a java archive?
Please let me know how to do this and then I can do further tests.
ASKER
I can now connect from one machine, I modified the autoexec.bat classpath so that it picks up the imaginary.zip classes, and it connects from Netscape on that machine.
However I can't connect from other machines, I get the same a class not found error in the Java console window.
How do I do this?
Mel
However I can't connect from other machines, I get the same a class not found error in the Java console window.
How do I do this?
Mel
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm using Visual Cafe for Database Development Edition to create the JAR file, I have no clue how to create it in the command line JDK. Anyway I created a jar which contains the msql classes and changed the html code so that the archive is included in the applet tag.
I ran the applet and it doesn't work. Do you know where I am going wrong?
I really don't understand how the JAR works, as the class code looks for com.imaginary.sql.msql.Msq lDriver, how does the applet know to look for the class in the JAR and not in the com directory.
I ran the applet and it doesn't work. Do you know where I am going wrong?
I really don't understand how the JAR works, as the class code looks for com.imaginary.sql.msql.Msq
The best way is to try to run the program under appletviewer. if the database is still not connecting then we know there is a problem with either the config, server or program.