Solved

Applet will not connect to msql database from Netscape

Posted on 1998-07-15
6
182 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

758 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

20 Experts available now in Live!

Get 1:1 Help Now