Link to home
Start Free TrialLog in
Avatar of help_me
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.imaginary.sql.msql.MsqlDriver");
String url = "jdbc:msql://firth.natcorp.ox.ac.uk:1114/linkmain";
Connection myConnection = DriverManager.getConnection(url,"","");

Configuration used:
Symantec Visual Cafe Pro 1.0e
Netscape Communicator v4.0.3
Imaginary mSQL driver - the driver directory 'com.imaginary.sql.msql.MsqlDriver'  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
Avatar of sdaxm11
sdaxm11

first of all have you used the jdk1.1 patch for netscape.

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.
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" .
Avatar of help_me

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.



Avatar of help_me

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
ASKER CERTIFIED SOLUTION
Avatar of aziz061097
aziz061097

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of help_me

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.MsqlDriver, how does the applet know to look for the class in the JAR and not in the com directory.