Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: jdbc connection security problem after register driver successful

Re: jdbc connection security problem after register driver successful

From: Andreas Vogler <vogler_at_etm.at>
Date: Tue, 13 Feb 2001 10:55:09 +0100
Message-ID: <982058360.464447@newsmaster-04.atnet.at>

Some time ago i had the same problem, but i couldn't REALY catch problem. Which Java-Version? Maybe its a problem with Java 1 (Browser). Are you using Java 2 with your JBuilder? I think i read something about this security(problem) on the sun homepage. Maybe it will work with a Browser with Java 2 (or Plugin)......

Andy

rr schrieb in Nachricht <3A74B7FE.53BF3733_at_look.ca>...
>I really need your help.
>I am having problems connecting to my Oracle 8.1.5i database, which runs
>on the same machine as the apache web server. I am using oracle thin
>driver classes111.zip.
>It works when I run it with JBuilder, so I know the port, sid, and
>server settings are correct.
>It seems to be a security problem.
>I also tried substituting the IP address for the name of the server, and
>got the same results.
>Thanks is advance for any tips you may be able to provide.
>rachel
>
>This is the output and error message:
>
>JDBC driver successfully loaded.
>Oracle Connect String=jdbc:oracle:thin:@192.168.0.3:1521:DB1
>DBConn() runtime problem!
>access denied (java.net.SocketPermission 192.168.0.3:1521
>connect,resolve)
>
>and here is the java code, contained within a jar file, sitting on the
>server's html directory:
>
>
> public DBConn( String user_id, String password )
> {
> String url;
> try
> {
> /*
> * Load the Oracle JDBC driver
> */
> Class.forName("oracle.jdbc.driver.OracleDriver");// .newInstance()
>
> url =
> MyJDBC.JDBCDRIVER
> + ":@" + MyJDBC.INTRANET_SERVER
> + MyJDBC.DB_PORT
> + MyJDBC.ORACLE_SID;
>
> System.out.println("JDBC driver successfully loaded.\nOracle
>Connect String=" + url);
>
> conn = DriverManager.getConnection (url, user_id, password );
> /*
> * if connection succeeds, will proceed to defined connected as
>true
> * otherwise, an SQLException will be raised
> */
> System.out.println( "Database connected." );
>
> } // try
> catch ( SQLException sqlex )
> {
> System.out.println( "SQLException" );
> reportSQLError(sqlex);
> close();
> } // catch ( SQLException sqlex )
> catch (Exception ex)
> {
> System.out.println("DBConn() runtime problem!");
> System.out.println(ex.getLocalizedMessage());
> close();
> }
> } // public DBConn (String, String)
>
>
>Here is the applet, contined in the same directory on the server as the
>jar file:
>
><HTML>
><HEAD>
><META HTTP-EQUIV="Content-Type" CONTENT="text/html;
>charset=windows-1252">
><TITLE>Jbuilder Project mynewjdbc.jpr</TITLE>
></HEAD>
><BODY>
><H1>Project Notes</H1>
><HR>
><FONT SIZE=+1>
><STRONG>Project: </STRONG>JDBC Intranet Applet<BR>
><STRONG>Description: </STRONG><BR>
>This applet provides a mechanism for querying the table assigned to the
>TABLE parameter (a parameter within this page's HTML code within the
>APPLET
>section.) The top half of this applet provides a panel to the user for
>the purpose of entering specific filter criteria in the fields provided
>and selecting a row from the resulting list. The bottom half provides
>the
>results of the selected row.
><HR>
>mynewjdbc.MyJDBC applet will appear below in a Java enabled browser.<BR>
>
><!--"CONVERTED_APPLET"-->
><!-- HTML CONVERTER -->
><OBJECT classid="clsid:E19F9330-3110-11d4-991C-005004D3B3DB"
>WIDTH = 780 HEIGHT = 500 NAME = "SwimmsApplet" ALIGN = middle VSPACE = 0
>HSPACE = 0
>codebase="http://java.sun.com/products/plugin/1.3.0_01/jinstall-130_01-win3
 2.cab#Version=1,3,0,1">
>
><PARAM NAME = CODE VALUE = "mynewjdbc.MyJDBC.class" >
><PARAM NAME = CODEBASE VALUE = "." >
><PARAM NAME = ARCHIVE VALUE = "swimms2.jar" >
><PARAM NAME = NAME VALUE = "SwimmsApplet" >
>
><PARAM NAME="type"
>VALUE="application/x-java-applet;jpi-version=1.3.0_01">
><PARAM NAME="scriptable" VALUE="false">
><PARAM NAME = WIDTH VALUE ="780">
><PARAM NAME = HEIGHT VALUE ="500">
><PARAM NAME = OWNER VALUE ="SWIMMS">
><PARAM NAME = TABLE VALUE ="WWSW_APPLET_DETAIL">
><PARAM NAME = LINK VALUE ="">
><PARAM NAME = INTRANET_SERVER VALUE ="192.168.0.3">
><PARAM NAME = DB_PORT VALUE =":1521">
><PARAM NAME = ORACLE_SID VALUE =":DB1">
><COMMENT>
><EMBED type="application/x-java-applet;jpi-version=1.3.0_01" CODE =
>"mynewjdbc.MyJDBC.class" CODEBASE = "." ARCHIVE = "swimms2.jar" NAME =
>"SwimmsApplet" WIDTH = 780 HEIGHT = 500 ALIGN = middle VSPACE = 0 HSPACE
>= 0 WIDTH = "780" HEIGHT = "500" OWNER = "SWIMMS" TABLE =
>"WWSW_APPLET_DETAIL" LINK = "" INTRANET_SERVER = "192.168.0.3" DB_PORT =
>":1521" ORACLE_SID = ":DB1" scriptable=false
>pluginspage="http://java.sun.com/products/plugin/1.3.0_01/plugin-install.ht
 ml"><NOEMBED>
>
><! If the WIDTH and HEIGHT values for the applet are changed above, also
>
>change them here below, so the applet knows its assigned dimensions: >
></NOEMBED>
></EMBED>
></COMMENT>
></OBJECT>
>
><!--
><APPLET CODE = "mynewjdbc.MyJDBC.class" CODEBASE = "." ARCHIVE =
>"swimms.jar" WIDTH = 780 HEIGHT = 500 NAME = "SwimmsApplet" ALIGN =
>middle VSPACE = 0 HSPACE = 0>
><PARAM NAME = WIDTH VALUE ="780">
><PARAM NAME = HEIGHT VALUE ="500">
><PARAM NAME = OWNER VALUE ="SWIMMS">
><PARAM NAME = TABLE VALUE ="WWSW_APPLET_DETAIL">
><PARAM NAME = LINK VALUE ="">
><PARAM NAME = INTRANET_SERVER VALUE ="192.168.0.3">
><PARAM NAME = DB_PORT VALUE =":1521">
><PARAM NAME = ORACLE_SID VALUE =":DB1">
><! If the WIDTH and HEIGHT values for the applet are changed above, also
>
>change them here below, so the applet knows its assigned dimensions: >
>
></APPLET>
>-->
>
>
><!--"END_CONVERTED_APPLET"-->
>
></BODY>
></HTML>
>
>
Received on Tue Feb 13 2001 - 03:55:09 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US