Applets Connecting to DataBases

I want to connect an applet to a database residing in my hard disk
but I come up with the message "AccessDeniedException" what is the best way to overcome this? does it concern my browser IE or the jave I am writing.

to alamnbr:
I suggest that you look at the notepad applet included in Java WebStart, which was installed along with Java - look for its icon on your desktop.
Also, please do not post to an existing thread if your post does not relate to the thread content - start a new thread, instead. Thanks

Similar Messages

  • HELP! Applet connecting too Database

    I am trying to connect an Applet too a Database file, that will be hosted in the same directory as the html, and jar files. The database connection and manipulation methods are in a seperate class, from the Applet.
    I get an error on the line:
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    It is beign caught in a try/catch, and I print out what is below, includes exception dump.
    Failed to load JDBC/ODBC driver.
    java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)
    Any help on why this is happening, and how I can fix it, would be appreciated.

    signing the applet, would remove almost all restrictions on the applet. But would it remove this restriction, since that particular error, is because the applet is trying to access a class that it is not allowed too.
    the client server model, would work also, but you have to leave the server side piece always running, even though it wont always be needed.
    a applet servlet setup, I believe could work, but serving servlets is not a capability the server currently has, and the admin, does not particularly want too add it.
    I asked for a specific database.
    I am in a large company, so maybe I can find what is suggested.
    Anymore ideas?
    I always appreciate input.

  • Applet connecting to MS SQL Database (Remote DataSourse)

    Hello,
    I started by building my interface to a Database within an Application. I am not to the point where I am ready to make it an applet but want to get some tips when the time comes very soon.
    First of all what security issues do I have to deal with to let the applet connect to the database?
    Second I currently created a local Datasource via ODBC call JavaDB and linked it to my MS SQL Database.
    QUESTION
    How do I link to the with a remote Datasource so that the local machine does not have to worry about the datasource.
    Lastly can I use the "sun.jdbc.odbc.JdbcOdbcDriver" in an applet. I sure hope so...
    Then the part of my code that connected to the database was this:
    private void initDB(){
    String url = "jdbc:ODBC:JavaDB";
    Connection con;
    String query = "select * from COFFEES";
    Statement stmt;
    try {
    //Class.forName("myDriver.ClassName");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());
    try {
    con = DriverManager.getConnection(url, DBADM, DBPWD);
    stmt = con.createStatement();                                   
    ResultSet rs = stmt.executeQuery(query);
    ResultSetMetaData rsmd = rs.getMetaData();
    System.out.println("");
    int numberOfColumns = rsmd.getColumnCount();
    for (int i = 1; i <= numberOfColumns; i++) {
         if (i > 1) System.out.print(", ");
         String columnName = rsmd.getColumnName(i);
         System.out.print(columnName);
    System.out.println("");
    while (rs.next()) {
         for (int i = 1; i <= numberOfColumns; i++) {
         if (i > 1) System.out.print(", ");
         String columnValue = rs.getString(i);
         System.out.print(columnValue);
         System.out.println("");     
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.print("SQLException: ");
    System.err.println(ex.getMessage());
    Thanks,
    Kenny

    Kenny,
    As no one has replied, I've managed to implement a database that uses applets.
    Firstly, one needs to obtain a JSP server (apache tomcat is free and can be configured into a IIS 4 server).
    Secondly, write all the DB connection stuff within a jsp page (ex.) "builders.jsp"
    <%@ page import="java.sql.*" %>
    <%!
    protected String driver="sun.jdbc.odbc.JdbcOdbcDriver";
    protected String url="jdbc:odbc:PhotoDBase";
    protected String userid=null;
    protected String passwd=null;
    %>
    <html><head><title>Builder Example</title></head><body>
    <%!
    public static String GET_BUILDER_QUERY =
    "SELECT * FROM BuilderInfo WHERE BuilderID =?";
    %>
    <%
    String bID = "24"; //normally this would use
    //request.Parameter("bID");
    //in order to pull up a specific
    //record. In this test case it is
    //hard coded to pull only builder #24
    %>
    <%
    Class.forName(driver);
    Connection conn = DriverManager.getConnection(url, userid, passwd);
    PreparedStatement stmt = conn.prepareStatement(GET_BUILDER_QUERY);
    stmt.setString(1, bID);
    ResultSet rs = stmt.executeQuery();
    rs.next();
         String buildID = rs.getString("BuilderID");
         String bName = rs.getString("BuilderName");
         String bAddress = rs.getString("Address");
         String bCity = rs.getString("City");
         String bState = rs.getString("State");
         String bZip = rs.getString("Zip");
         String bCName = rs.getString("ContactName");
         String bCLast = rs.getString("ContactLast");
         String bPhone = rs.getString("Phone");
         String bFax = rs.getString("Fax");
         String bMobile = rs.getString("Pager/Cell");
    rs.close();
    stmt.close();
    if (bName == null)
         bName = "No Builder";
    if (bAddress == null)
         bAddress = "N/A";
    if (bCity == null)
         bCity = "N/A";
    if (bState == null)
         bState = "N/A";
    if (bZip == null)
         bZip = "N/A";
    if (bCName == null)
    bCName = "N/A";
    if (bCLast == null)
         bCLast = "N/A";
    if (bPhone == null)
         bPhone = "N/A";
    if (bFax == null)
    bFax = "N/A";
    if (bMobile == null)
    bMobile = "N/A";
    %>
    <p>Builder: <%= bName%> BuilderID #: <%= buildID%>
    <br>Contact: <%= bCName%> <%= bCLast%>
    <br>Address: <%= bAddress%>
    <br><%= bCity%>, <%= bState%> <%= bZip%>
    <br>Phone: <%= bPhone%>
    <br>Fax: <%= bFax%>
    <br>Mobile: <%= bMobile%>
    <p><applet code="Build.class" width="600" height="300">
    <param name=buildID value=<%= buildID%>>
    <param name=bName value="<%= bName%>">
    <param name=bAddress value="<%= bAddress%>">
    <param name=bCity value="<%= bCity%>">
    <param name=bState value="<%= bState%>">
    <param name=bZip value="<%= bZip%>">
    <param name=bCName value="<%= bCName%>">
    <param name=bCLast value="<%= bCLast%>">
    <param name=bPhone value="<%= bPhone%>">
    <param name=bFax value="<%= bFax%>">
    <param name=bMobile value="<%= bMobile%>">
    </applet>
    </body>
    </html>
    The jsp gets the data from the DB based on the parameter bID which would be passed to it via a search or input page with various error checking included.
    The applet then recieves its data via parameters. (Build.class has been shortened here to show you the meat and potatoes of the whole deal)
    //<applet code="Build.class" width="600" height="300"></applet>
    import java.awt.*;
    import java.awt.Event;
    import java.applet.Applet;
    import java.io.*;
    public class Build extends java.applet.Applet {
    protected Panel search ;
    protected TextField Nametxt ;
    protected TextField Loctxt ;
    protected TextField Citytxt ;
    protected TextField Statetxt ;
    protected TextField Ziptxt ;
    protected TextField CNametxt ;
    protected TextField CLasttxt ;
    protected TextField Phonetxt ;
    protected TextField Faxtxt ;
    protected TextField Celltxt ;
    public Build(){
    super();
    search = new Panel();
    Nametxt = new TextField();
    Loctxt = new TextField();
    Citytxt = new TextField();
    Statetxt = new TextField();
    Ziptxt = new TextField();
    CNametxt = new TextField();
    CLasttxt = new TextField();
    Phonetxt = new TextField();
    Faxtxt = new TextField();
    Celltxt = new TextField();}
    public void init(){
         BorderLayout bl = new BorderLayout();
         setLayout(bl);
         add(search, "Center");
         setBackground(Color.white);
         String buildID = getParameter("buildID");
         String bName = getParameter("bName");
         String bAddress = getParameter("bAddress");
         String bCity = getParameter("bCity");
         String bState = getParameter("bState");
         String bZip = getParameter("bZip");
         String bCName = getParameter("bCName");
         String bCLast = getParameter("bCLast");
         String bPhone = getParameter("bPhone");
         String bFax = getParameter("bFax");
         String bMobile = getParameter("bMobile");
    Nametxt.setText(bName);
    Loctxt.setText(bAddress);
    Citytxt.setText(bCity);
    Statetxt.setText(bState);
    Ziptxt.setText(bZip);
    CNametxt.setText(bCName);
    CLasttxt.setText(bCLast);
    Phonetxt.setText(bPhone);
    Faxtxt.setText(bFax);
    Celltxt.setText(bMobile);
    Hope this will aid you in yours and anyone elses endevours.
    James <[email protected]>

  • Connectivity of database through applet

    Hi to all,
    I want to how to make the connectivity of database(preferably mySql) to java application through applet....

    Possible answers to a more focused question:
    Make sure the jar file containing the JDBC driver is in your applet's classpath.
    Read the JDBC tutorial.
    Make sure that the network connectivity between your client and the database is working.
    Any of those sound right? No? Want to ask a more specific question?

  • Connecting to database through applet

    hi friends
    I am trying to connect to sql database through applet but I cant.
    in fact it can not connect to database.
    plz any body tell me how can i do this. Thanks

    // class depends on
    //     msbase.jar
    //     mssqlserver.jar
    //     msutil.jar
    // these api's are part of Microsoft SQL Server 2000 Driver for JDBC
    // allso need JNDI file system Service provider: found @ sun http://java.sun.com/products/jndi/#DOWNLOAD12 the JNDI 1.2.X class librarys and
    //          File system provider 1.2 beta 3
    //     fscontext.jar
    //     providerutil.jar
    //      (jndi.jar) provided in java > 1.3*
    // to compile:
    // javac -classpath "C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;C:\j2sdk1.4.2_01\jndi\lib\fscontext.jar;C:\j2sdk1.4.2_01\jndi\lib\jndi.jar;C:\j2sdk1.4.2_01\jndi\lib\providerutil.jar" SQLTest.java
    import javax.sql.*;
    import java.sql.*;
    import javax.naming.*;
    import java.util.Properties;
    public class SQLTest extends Thread {
        String sqlServerUser = "sql login account";
        String sqlServerPWD = "sql password";
        String sqlServerName = "sql machine";
        String sqlServerPort = "1433";
        public SQLTest() {
        public static void main(String[] args) {
            (new SQLTest()).run();
        public void run(){
            Connection conn = null;
            try{
                Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
                conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://" + sqlServerName + ":"+ sqlServerPort + ";User=" + sqlServerUser + ";Password=" + sqlServerPWD + ";ProgramName=JAVA-jdbc;DatabaseName=Northwind");
                Statement stmt = conn.createStatement();
                ResultSet result = stmt.executeQuery(
                    "SELECT * from [Shippers]"
                if(result.next()){
                    System.out.println(result.getString("CompanyName") + " " + result.getString("Phone"));
                    while(result.next()) {   // for each row of data
                        System.out.println(result.getString("CompanyName") + " " + result.getString("Phone"));
                System.out.println("Getting a connection with drivermanager works fine");
            } catch(Exception e){
                e.printStackTrace(System.out);
            } finally{
                try{
                    conn.close();
                } catch(Exception e){
                    e.printStackTrace(System.out);
            if(true){return;}
    // try it with a datasource
            try{
            // Setting the context:
                com.microsoft.jdbcx.sqlserver.SQLServerDataSource sds = new com.microsoft.jdbcx.sqlserver.SQLServerDataSource();
                sds.setServerName(sqlServerName);
                sds.setDatabaseName("Northwind");
                sds.setNetAddress(sqlServerPort);
                Properties p = new Properties();
                p.put(Context.INITIAL_CONTEXT_FACTORY,     "com.sun.jndi.fscontext.RefFSContextFactory");
                Context ctx = new InitialContext(p);
                try{
                    ctx.unbind("jdbc/EmployeeDB");
                }catch(Exception e){
                }finally{
                    ctx.bind("jdbc/EmployeeDB",sds);
                DataSource ds = (DataSource)ctx.lookup("jdbc/EmployeeDB");
                conn = null;
                conn = ds.getConnection(sqlServerUser,sqlServerPWD);
                Statement stmt = conn.createStatement();
                ResultSet result = stmt.executeQuery(
                    "SELECT * from [Shippers]"
                if(result.next()){
                    System.out.println(result.getString("CompanyName") + " " + result.getString("Phone"));
                    while(result.next()) {   // for each row of data
                        System.out.println(result.getString("CompanyName") + " " + result.getString("Phone"));
                System.out.println("works with datasource");
            } catch(Exception e){
                e.printStackTrace(System.out);
            } finally{
                try{
                    conn.close();
                } catch(Exception e){
                    e.printStackTrace(System.out);
    }To give an applet special privileges you can specify the prifs in the java.policy file or sign the applet and choose "yes I trust" or "yes I allways trust" when the applet is loaded.
    To give special prifs with the java.policy, it should look like this:
    grant {
    permission java.lang.RuntimePermission "usePolicy"; // prevents the popup from showing for signed applets
    grant codeBase "file:C:/-" {
      permission java.security.AllPermission;
    grant codeBase "http://localhost/-" {
      permission java.security.AllPermission;
    };

  • How to i get the connect to database with OLAP API 9.2.0.0

    hi all,
    when i use the OLAP API (9.2.0..0) to connect the database,i gained the message of the following:
    java.lang.NoClassDefFoundError: com/sun/java/util/collections/HashMap
    void oracle.express.olapi.transaction.ExpressTransactionProvider.<init>()          ExpressTransactionProvider.java:40
         void mypackage3.APPEX.init()
              APPEX.java:51
         void sun.applet.AppletPanel.run()
              AppletPanel.java:344
         void java.lang.Thread.run()
              Thread.java:484
    JDev=9.0.3
    OLAP API=9.2.0.0
    Oracle 9i 9.2.0.1
    and how can i get the OLAP API 9.2.0.4.1?
    anyone can help me !
    thanks!!!

    Hi, yes, there are at least two known ways:
    1. if you happen to have a UCCX premium, you can create an HTTP application that serves up the prompt file,
    2. you can try to access the prompt file like this: http://<uccxip>:9080/prompts/dirname/promptfilename.wav
    G.

  • Cannot connect to database via JApplet

    Hi,
    I created a Java application which allows me to send information to my mysql database using the jdbc connector via a JFrame. However when i modified the file to be a JApplet the info will not sent and i cannot connect to the database? Any particular reason for this?
    I need it to be a JApplet so i can add it to a browser window.
    Code: ( java )
    private void save ()
    Connection conn = null;
    try
    Statement stmt;
    String userName = "root";
    String password = "PASSWORD";
    String url = "jdbc:mysql://localhost:3306/DATABASE";
    Class.forName ("com.mysql.jdbc.Driver").newInstance ();
    conn = DriverManager.getConnection (url, userName, password);
    System.out.println ("Database connection established");
    //Get a statement object
    stmt = conn.createStatement();
    stmt.executeUpdate( "INSERT INTO TABLE(Info i know to put in) VALUES('Values i know to put in')");
    catch (Exception e)
    System.err.println ("Cannot connect to database server");
    finally
    {if (conn != null)
              {try
                   {conn.close ();       
    System.out.println ("Database connection terminated");
    catch (Exception e) { /* ignore close errors*/  }
    As i said above it works fine as a JFrame but not as a JApplet. Any help would be great.
    Thanks G

    Your error reporting is not good. You print a meanningless message or ignore the error.
    Print the stacktrace in the catch blocks.
    Change the code, rerun it and then check the Java Console for output.
    I'm guessing you'll see a security error. Unsigned applets can't access the client file system. If so, sign the applet.

  • Can signed applet taked to database directly

    Hi All,
    I have a signed applet download from the web server. It works well to write files to client machine.
    My question is that can this applet talk to database which the ip address is different with the web server.
    Thanks
    Scott

    I am trying to connect to an Access database from a signed applet. Both the applet and database are in the local machine. I am getting an exception from the security manager. Do you know how can I get permission from the security manager for my applet to access the database ?
    Thanks

  • Eclipse can connect in database perspective, but Java program can't

    I am totally new to JAVA, so I expect I am making a prize goof somewhere...
    On my Macbook Pro (OS X 10.5) I have installed MySql and Eclipse and I have created a database with a number of tables populated with data (using phpmyadmin).
    I seem to have the drivers in the right places and the classpath set correctly, because I can see my database, tables and columns in the "database perspective" in Eclipse. (I can see and manipulate my database in a variety of admin tools - so I think I have my user id, password and permissions set correctly.)
    So, Eclipse can connect to my data base, but the following little Java test program can't can't connect to it.
    I copied this sample test program from a website and supplied the parameters for user id, password and url, but I get the console message, "cannot connect to database server" each time i run it within the Eclipse sdk:
    import java.sql.*;*
    public class connect
    public static void main (String[] args)
    Connection conn = null;
    try
    String userName = "root";
    String password = "mypassword";
    String url = "jdbc:mysql://localhost:3306/testdatabase";
    Class.forName ("com.mysql.jdbc.Driver").newInstance ();
    conn = DriverManager.getConnection (url, userName, password);
    System.out.println ("Database connection established");
    catch (Exception e)
    System.err.println ("Cannot connect to database server");
    finally
    if (conn != null)
    try
    conn.close ();
    System.out.println ("Database connection terminated");
    *catch (Exception e) { /* ignore close errors */ }
    Any Ideas why eclipse can connect, but this little program can't?

    Almost nothing uses the system classpath anymore. IDE's, when they execute and compile projects, setup "custom" environments for those projects, web containers and application servers do the same for the applications they are responsible for, applets use the "codebase" and "archive" params, when you use the "-cp" option, the System classpath is also ignored, and when you use "-jar" both "-cp" and the system classpath are ignored. IOW, never depend on the system classpath. That is an outdated way of managing your environments, especially when you have applications running on varying versions of the JVM.

  • Java Applets connecting to Oracle DB thru OAS (JNDI)

    i am developing an application, like i said before, i am using three applets, one controls a webcam, (records an image to disk and oracle), another controls a Electronic signature pad (records an image to disk and oracle), and finally a finger print reader (the same with this), at the beginning i didnt have any problem at all connecting this applet to the database, but top management wants to do things in another way, not allowing me to connect the applet directly to the database for security reason, My app resides on Oracle Application Server, and i use DataSource and Connection Pooling,
    I want that this applets use the available datasource on OAS to connect to the Database, due that the DataBase IP Address wont be public but OAS IP address will, I know that i must use JNDI to accomplish this, but i didnt have any results at all
    Message was edited by:
    efebo_abel2002

    i retrieved all the datasources from my app and i got this, i show my code and the returned errors, I can't connect my applet to the DB thru OAS datasources, any suggestions?
    package rdf.struts.ajax;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NameClassPair;
    import javax.naming.NamingEnumeration;
    import javax.naming.NamingException;
    import javax.sql.DataSource;
    public class ConductoresClient2 {
    public static void main(String [] args) {
    try {
    final Context ctx = getInitialContext();
    System.out.println(ctx!=null?"ctx no es null":"ctx es null");
    NamingEnumeration nenum=ctx.list("jdbc");
    while (nenum.hasMore()) {               
    NameClassPair entry = (NameClassPair)nenum.next();
    System.out.println("entry:="+entry.getName());
    try {
    DataSource ds=(DataSource)ctx.lookup("jdbc/"+entry.getName());
    Connection conn=ds.getConnection();
    Statement stm=conn.createStatement();
    ResultSet rs=stm.executeQuery("SELECT * FROM palic_ow.conductores");
    while(rs.next())
    System.out.println("rs.getString(1):="+rs.getString(1));
    System.out.println("rs.getString(2):="+rs.getString(2));
    System.out.println("rs.getString(3):="+rs.getString(3));
    catch (Exception e) {
    System.out.println("Exception conectando a la base :"+e);
    //java:comp/env/
    }catch (Exception e) {
    System.out.println("Exception obteniendo Context "+e);
    private static Context getInitialContext() throws NamingException {
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"oracle.j2ee.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL,"oc4jadmin");
    env.put(Context.SECURITY_CREDENTIALS,"admin");
    env.put(Context.PROVIDER_URL,"ormi://localhost:23791/sertracen");
    return new InitialContext( env );
    ctx no es null
    entry:=OracleDS
    Exception conectando a la base :javax.naming.NamingException: Lookup error: javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable]; nested exception is:
         javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable] [Root exception is javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable]]
    entry:=v8PooledDS
    Exception conectando a la base :javax.naming.NamingException: Disconnected: java.lang.NoClassDefFoundError: javax/resource/Referenceable
    entry:=caom
    Exception conectando a la base :javax.naming.NamingException: Lookup error: javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable]; nested exception is:
         javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable] [Root exception is javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable]]
    entry:=v8DS
    Exception conectando a la base :javax.naming.NamingException: Lookup error: javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable]; nested exception is:
         javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable] [Root exception is javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable]]
    entry:=v8CoreDS
    Exception conectando a la base :javax.naming.NamingException: Lookup error: javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable]; nested exception is:
         javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable] [Root exception is javax.naming.NamingException: javax/resource/Referenceable [Root exception is java.lang.NoClassDefFoundError: javax/resource/Referenceable]]
    Process exited with exit code 0.
    null

  • MS SQL SERVER-APPLET CONNECTION WITHOUT ODBC

    ONE QUESTION ALL
    Can it be achieved? I want to setup a database on a running sql server. On the same machine both and then i want to connect an applet with the database!! Please tell me if it can be done and any source code would be helpful!!!
    e-mail:[email protected]
    i will look again here but if you have anything send it here on this e-mail!!!
    I need some answer please!

    To connect to sql server directly from an applet is a waiste of time.
    Do multiple clients use your applet?
    yes:
    You have to write server side script on the same server that the applet came from that
    does the database work according to submitted values from the applet (applet uses url
    urlconnection POST or GET).
    If you want the applet to connect directly you have to sign the applet or set up a policy and
    tell all the clients to install the needed jdbc classes.
    no:
    Write an application using swing.

  • How can an client-applet connect to server-DB?

    as the subject.
    I want the applet@client-side connect to DataBase@server-side,
    I am using Tomcat as engine & JDBC-mysql as tools
    where should the jdbc class placed in? WEB-INF/classes ? WEB-INF/lib ?? or others?
    now i am facing the problem that the applet seems cannot access WEB-INF and cannot locate the jdbc driver.
    could anybody give me some hints?
    thank you very much

    Hello
    I don't know the answer, sorry. This is the jdb (java debugger) tool forum.
    You might want to post your question over on the JDBC forum.
    Try this link:
    http://forum.java.sun.com/forum.jsp?forum=48

  • Forms not connecting to database in browser

    Hi All
    I have got Oracle9i Personal Database and Oracle Developer installed on my Windows XP professional machine.
    I can connect to the database in SQL*Plus and I can connect to the databse to compile the form, but when the browser opens all I get is a big blank green square. The applet has initialised and the java icon has loaded into the task bar, but no information. I also noticed in the address bar that the name of my database is not there. i.e username/password@<database name>&buffer_record etc. If I add the name of the database in the address I then get login dialog box the TNS protocol adapter error message pops up.
    I have OC4J running and I can get to the main page if I don't add the form name which tells me the server is running, but nothing in the browser.
    Any help or hints would be appreciated

    Here is the output
    Driver loaded
    Authorising for: test - testpass
    Protocol connecting to database
    Exception in Protocol: java.sql.SQLException: No suitable driver
    java.sql.SQLException: No suitable driver
         at java.sql.DriverManager.getConnection(DriverManager.java:532)
         at java.sql.DriverManager.getConnection(DriverManager.java:171)
         at baeauthserver.AuthProtocol.getPMConnection(AuthProtocol.java:66)
         at baeauthserver.AuthServerThread.run(AuthServerThread.java:38)The program is a server daemon or service that listens for connections from a client. On connection the server spawns a "work" thread to deal with authorising the user and creating a database connection. I can make a connection in the main server class (i.e. the main thread) but as soon as I move this to the "work" class it seems to lose the driver.
    I've just done some more tests and I can't even grab the driver as a driver object on the work thread so it's not just the getConnection method.
    I'm initialising the driver in a static block in the main server program. I've moved it around to various constructors on both the main class and the work class to no avail.
    It has me stumped so far :p
    Thanks for the input though :)

  • Can applet connect Oracle???

    Hi,
    I have a class which contains:
    "Class.forName("oracle.jdbc.driver.OracleDriver");"
    If I run it using java myclass, everything is fine and
    the application gives a result set from Oracle.
    If I run it under applet (appletviewer myclass.html),
    I got "ClassNotFoundException" error.
    I saw one reply here saying applets cannot connect to
    database.
    Anyone can give a help?
    Thanks,

    I saw one reply here saying applets cannot connect todatabase.
    That isn't true.
    It is just more difficult.
    You have to pass the jar with the Oracle stuff to the applet (just like any other jar.) If you don't know how to do this you might want to ask on a forum that discusses applets.
    Presumably you are using the thin driver. The OCI driver won't work.
    Presumably the database server is the same as the web server or you have already figured out the security issues with connecting to a different server. If you don't know how to do this you might want to ask on a forum that discusses applets.

  • Test connection in Database component is failed

    In JDeveloper 2.0 when I try test connection in Database
    component I get message:
    borland.jbcl.dataset.DataSetException: End of TNS data channel
    at
    borland.jbcl.dataset.DataSetException.throwException(Compiled
    Code)
    at
    borland.jbcl.dataset.DataSetException.throwException(Compiled
    Code)
    at
    borland.jbcl.dataset.DataSetException.SQLException(Compiled Code)
    at borland.sql.dataset.Database.openConnection(Compiled
    Code)
    java.sql.SQLException: End of TNS data channel
    at
    oracle.jdbc.dbaccess.DBError.check_error(DBError.java:363)
    at
    oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:
    125)
    at
    oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:155)
    at
    java.sql.DriverManager.getConnection(DriverManager.java:91)
    at
    java.sql.DriverManager.getConnection(DriverManager.java:134)
    at borland.sql.dataset.Database.openConnection(Compiled
    Code)
    I try use JDBC Thin 8.0.5 and 8.1.4
    My Applet work is fine. In JDeveloper 1.0 (AppBuider) I not get
    this message.
    It's bug?
    null

    Hi Eugeny,
    If you are using the JDBC 8.0.5 driver to connect to an 8.1.4
    database, you need to make sure of the following:
    * within the JDeveloper IDE, open Project->Project Properties
    from the menu
    * in the libraries list, make sure that Oracle 8.0.5 JDBC appears
    in the list of libraries before BOTH Oracle 8.1.4 JDBC AND
    'Enterprise Java Beans'
    If the Oracle 8.0.5 JDBC library appears after either of the
    above two libraries, select it in the list, and drag it up so
    that it appears first. Save your project and retry the compile.
    I think this may be what is causing the errors. Please reply if
    this does not fix your problem, or if I misunderstood.
    - Laura
    Eugeny Orlov (guest) wrote:
    : In JDeveloper 2.0 when I try test connection in Database
    : component I get message:
    : borland.jbcl.dataset.DataSetException: End of TNS data channel
    : at
    : borland.jbcl.dataset.DataSetException.throwException(Compiled
    : Code)
    : at
    : borland.jbcl.dataset.DataSetException.throwException(Compiled
    : Code)
    : at
    : borland.jbcl.dataset.DataSetException.SQLException(Compiled
    Code)
    : at borland.sql.dataset.Database.openConnection(Compiled
    : Code)
    : java.sql.SQLException: End of TNS data channel
    : at
    : oracle.jdbc.dbaccess.DBError.check_error(DBError.java:363)
    : at
    oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:
    : 125)
    : at
    : oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:155)
    : at
    : java.sql.DriverManager.getConnection(DriverManager.java:91)
    : at
    : java.sql.DriverManager.getConnection(DriverManager.java:134)
    : at borland.sql.dataset.Database.openConnection(Compiled
    : Code)
    : I try use JDBC Thin 8.0.5 and 8.1.4
    : My Applet work is fine. In JDeveloper 1.0 (AppBuider) I not get
    : this message.
    : It's bug?
    null

Maybe you are looking for

  • Process runs in the background and shown as an icon next the clock (how to?

    Hi guys, I have a program that runs in the background (a daemon). It refers to a database and make some calculations. If it's not activated, the database will lack some critical information. For this propose, I eliminated the closing option from the

  • Bitmaps vs. Vector Shapes

    So I'm making a site(duh). And I have read multiple times that a vector shape has all the advantages. Their sizeable, and faster loading and just gerenerally better for web design. I have read that alot. Did I really read that? Are Vector Shapes real

  • [solved] can't download logic 9 from appstore

    hello there. i reinstalled snow leopard after had been some mavericks issues. but i can't download a logic 9 on the appstore... where can i download logic 9?

  • Problem with placing calls with Samsung phone

    My Samsung phone will ring and place a call, but I cannot hear anything when the person answers my call or I answer a call.

  • Error when creating table (Document contains no data)

    Hi, I've installed htmldb 2.0 and after playing with it for a while, everything seems to be ok, except for table creation. No matter I use the sql command console or the object creation wizard, the situation is the same: i can arrive until the last c