Solved

Applet will not connect to msql database from Netscape

Posted on 1998-07-15
6
192 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
ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

 

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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
simple java question 3 56
javap bin 2 34
Opening PDF on button click and fill new document 2 38
Detect Closed Loops (circles, figure-8s, etc) in PNG Images 6 33
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
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.

772 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