Solved

Applet will not connect to msql database from Netscape

Posted on 1998-07-15
6
186 Views
Last Modified: 2013-11-23
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
0
Comment
Question by:help_me
  • 3
  • 2
6 Comments
 

Expert Comment

by:sdaxm11
ID: 1226505
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.
0
 
LVL 2

Expert Comment

by:aziz061097
ID: 1226506
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" .
0
 

Author Comment

by:help_me
ID: 1226507
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.



0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:help_me
ID: 1226508
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
0
 
LVL 2

Accepted Solution

by:
aziz061097 earned 80 total points
ID: 1226509
Hi Mel,

Here is the javasoft site where Jars are explained. Jar has the similar syntax as "tar" on unix which also archives files together in to a single file. If you need more details let me know. The browser picks up your system classpath on the machine where you changed the autoexec.bat but since the classpath on other machines do not have the classes they do not work , you have to provide the classes using this jar and everything will work .

http://java.sun.com/products/jdk/1.1/docs/guide/jar/index.html
0
 

Author Comment

by:help_me
ID: 1226510
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java 1603 Error 3 50
PDFBox - convert image to PDF, PDF resolution 3 118
create a gui in perl 3 72
github account with ecipse 1 42
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now