Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Applet will not connect to msql database from Netscape

Posted on 1998-07-15
6
Medium Priority
?
219 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 

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 160 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

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…
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 will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This video teaches viewers about errors in exception handling.
Suggested Courses

722 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