Database-connect within a JAR

Database-connect within a JAR

Post by Dirk Uebbe » Fri, 03 Jul 1998 04:00:00

Hello all,

I have a probem with connecting to an database in the case, that
my applet-class is packed in a JAR-archive. The same source-code,
not in a JAR-file, is running with no problems. But as I am putting
it into a JAR-archive, I am getting a message in the Netscape Java
Console, which look like this:

Netscape Communications Corporation -- Java 1.1.5
Type '?' for options.
Symantec Java! ByteCode Compiler Version 210.065
Copyright (C) 1996-97 Symantec Corporation
Hallo_2 security.Couldn't connect to 'NTSV03' with origin from ''.
  at java.lang.Throwable.<init>(Compiled Code)
  at java.lang.Exception.<init>(Compiled Code)
  at java.lang.RuntimeException.<init>(Compiled Code)
  at java.lang.SecurityException.<init>(Compiled Code)
  at<init>(Compiled Code)
  at<init>(Compiled Code)
  at Code)
  at Code)
  at Code)
  at java.lang.SecurityManager.checkConnect(Compiled Code)
  at Code)
  at Code)
  at<init>(Compiled Code)
  at oracle.sqlnet.SQLnet.Connect(Compiled Code)
  at oracle.sqlnet.SQLnet.Connect(Compiled Code)
  at oracle.sqlnet.SQLnet.Connect(Compiled Code)
  at oracle.jdbc.ttc7.TTC7Protocol.connect(Compiled Code)
  at oracle.jdbc.ttc7.TTC7Protocol.logon(Compiled Code)
  at oracle.jdbc.driver.OracleConnection.<init>(Compiled Code)
  at oracle.jdbc.driver.OracleDriver.connect(Compiled Code)
  at java.sql.DriverManager.getConnection(Compiled Code)
* at java.sql.DriverManager.getConnection(Compiled Code)
  at Haupt_applet.init(Compiled Code)
  at netscape.applet.DerivedAppletFrame$InitAppletEvent.dispatch(Compiled Code)
  at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code)
  at Code)
  at netscape.applet.DerivedAppletFrame$ Code)

The source-code of the applet look like this:

import java.applet.*;
import java.sql.*;
import java.awt.*;

public class Haupt_applet extends Applet {

        public void init()
            Connection con_to;
                Connection con_from;

                setBackground(new Color(12632256));

        //      StDtVerwaltung StDtVerw = new StDtVerwaltung();

                try {


                    DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver ());






        //          StDtVerw.Datenbank_anlegen(con_to);



                    catch ( e) {

                    catch (java.lang.Exception ex) {



As you are able to see, I am using der Capability-class from Netscape, to get the
UniversalConnect-Privilege, which let me connect to the database server. But only, if I am not
putting my Applet in a JAR-archive!! And this is the problem.

I would be very glad, if you could help me please or if you could show me some place in WWW, where
I get help on this.

Waiting for your answer,



Dirk Uebber                         phone: +49 7031 873 534
Sindelfingen                        fax  : +49 7031 873 535



1. Connect to Oracle database from within VB

Hi there,

Does anybody know how to connect to an Oracle database from within a Visual
Basic executable ?
I have problems establishing this connection (I used to work with MS SQL).

Here is a description of the problem :

In the Oracle doc I find following info to connect to a database.  The
connection string should contain following parameters :
     DSN : The name of the data source.

     DBQ : An Oracle connect string.For more information, refer to the
SQL*Net documentation.

     UID : The user login ID.

     PWD : The user-specified password.

     ASY ON or OFF. This keyword will override the Asynchronous default you
had specified while setting up

So I tried in my VB program :

dim conn as ADODB.Connection

set conn = CreateObject("ADODB.Connection")

conn.Open "DSN=odbctest;;UID=guest;PWD=pipo;ASY=ON"

But no luck... doesn't work.

I have no problems to connect to MS SQL Server and to Access.  However my
connectionstring for Oracle doesn't seem to work.

Any ideas over there ?

Thanks for any reply


2. Phantom users

3. Using user's oracle credentials to connect to database within BMP

4. String processing changes in 11.5

5. Database applet and signed jar

6. SELECT TOP bug?

7. Can't connect to SQLServer using a dataSource within a Session bean

8. Hosting troubles

9. Possible to connect to ODBC within TSQL?

10. connecting to linked server from within trigger

11. connecting within a workgroup

12. Error connecting to SQL Server 7.0 from within a class