Regarding  problem  of database connectivity of JApplet

Below written code gives the error "JAVA.Lang.RuntimePermissionaccessClasslnPackage.sun.jdbc.odbc".
import javax.swing.*;
import java.sql.*;
import java.awt.event.*;
import java.awt.*;
public class appletDatabase extends JApplet implements ActionListener {
JLabel l1;
JLabel l2;
JLabel l3;
JTextField tf1;
JPasswordField tf2;
JButton btn;
Connection cn;
Statement st;
String hostname;
public void init() {
//hostname = "localhost";
l1 = new JLabel("User Name: ");
l2 = new JLabel(" Password: ");
l3 = new JLabel(" ");
tf1 = new JTextField(20);
tf2 = new JPasswordField(20);
btn = new JButton("Sign in");
Container c = getContentPane();
c.setLayout(new FlowLayout(FlowLayout.LEFT));
c.add(l1);
c.add(tf1);
c.add(l2);
c.add(tf2);
c.add(btn);
c.add(l3);
btn.addActionListener(this);
setSize(300,300);
setVisible(true);
public void actionPerformed(ActionEvent e) {
if (e.getSource()==btn)
     JOptionPane.showMessageDialog(null,"btn click");
     check();
     JOptionPane.showMessageDialog(null,"success");
public void check() {
String query="SELECT * from TBJAVA";
try {
     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
     cn = DriverManager.getConnection("jdbc:odbc:Temp","trg123","training");
     st = cn.createStatement();
     ResultSet rs = st.executeQuery(query);}
/*if (!(rs==null))
if (rs.next())
b = true;
rs.close();
st.close();
cn.close();
/* catch (SQLException e1) {
          e1.printStackTrace();
          JOptionPane.showMessageDialog(null,"error in sql exception");
catch (ClassNotFoundException e1) {
          e1.printStackTrace();
          JOptionPane.showMessageDialog(null,"error in class not founf");
     catch (Exception e1) {
          e1.printStackTrace();
          JOptionPane.showMessageDialog(null,"error in exception"+e1.getMessage());
corresponding HTML code is given below:
<html>
<head>
</head>
<body><applet code="appletDatabase" width =400 height =400></applet>
</body>
</html>
Please help
regards
kamal preet

Please use code tags when posting code
Applet sandbox do not allow you to access local system respurces unless the applet is signed.
jdbc:odbc bridge always connect to the ODBC interface in the local system.

Similar Messages

  • Problem with database connectivity

    Hi guys,
    I'm having a problem with database connectivity . I'm using the mySQL database & org.gjt.mm.mysql driver.
    I've kept the org folder under the directory where the Database.java program is residing .
    My program is as follows:
    import java.sql.*;
    public class Database
         Connection con;
         public void connect()
              System.out.println("In connect.");
         public Connection connectDB(String username,String password,String database)
              try
                   Class.forName("org.gjt.mm.mysql.jdbc.Driver");
                   String url="jdbc:mysql:"+database;
                   con=DriverManager.getConnection(url,username,password);
              catch(SQLException e)
                   System.out.println("SQL Exception caught:"+e);     
              catch(Exception e)
                   System.out.println("Exception e caught:"+e);     
              return con;
         public static void main(String args[])
              try
              Connection c;
              Database db=new Database();
              c=db.connectDB("root","","//192.168.0.2/squid");
              System.out.println("Connection created.");
              c.close();
              catch(Exception e)
                   System.out.println("Exception caught:"+e);     
    It gets compiled but gives the following error when run.
    Exception e caught:java.lang.ClassNotFoundException: org.gjt.mm.mysql.jdbc.Driver
    Connection created.
    Exception caught:java.lang.NullPointerException
    I don't know why the class is not found.Pl . help me rectify my mistake.Is there any other path to be set?
    Thanks.

    You need to run it with the JDBC driver in the classpath
    java -classpath .;[mySqlJdbcDriver.jar] Database

  • Problem with database connectivity toolkit

    I have problem with Labview database connectivity toolkit. I build and deploy the real_web.vi (attached to the post) to the web server. It seems that the DB Tools Open Connect can not connect to the data base, and it issues the following error:
    NI_Database_API.lvlib:DB Tools Open Connec (String).vi->real_web.vi->real_web.vi.ProxyCallerADO Error: 0x80004005 Exception occured in Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified in NI_Database_API.lvlib:DB Tools Open Connec (String).vi->real_web.vi->real_web.vi.ProxyCaller
    But in highlight execution, I do not get this error! My program connects to the database and read the data. What is wrong ?
    Moreover, when I connect to the vi using the web-browser, the cpu usage of ApplicationWebServer process goes up to 100% (The same problem as stated in this post). 
    Attachments:
    real_web.vi ‏28 KB

    Say what you will about the problems that the DCT can cause (and goodness knows I have) my suspicion is that this is not a toolkit ptoblem. When ever something only works with execution highlighting on, two words should immediately jump to mind: "race" "condition".
    Execution highlighting will muck aound with the order in which things get done in your code. Can you post what your code looks like?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Problem installing Database connectivity toolkit

    My company manufactures in multiple plants around the world.  I have a problem in China and need to debug, and since the code is distributed in exe form, that is a problem.  My approach was to install a 30 day trial license of LV2010 SP1, planning on removing it when the debug is done.  To this point, all is fine.  The problem is that the app requires the Database Connectivity Toolkit.  I downloaded a copy and tried to install.  It says it can't install because LV2010 is not installed.  Is this because of the eval license?
    Solved!
    Go to Solution.

    Very likely, but the far better solution is to not burden yourself with the DCT. It is a major complication to a process that is essentially very simple. As an alternative check this thread.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Processes 'stuck' after problems with database connection

    First in the production environment, during database failover (MSSQL Server cluster), and later in testing, we encountered processes that are 'stuck' on some random operation. Admin console doesn't show stalled operation or branches, process is running, all operations are completed except last which was in several cases still in status Running, and in one case it was Completed but next operation was not started.
    When operation is still running one would expect to select it and click 'Retry' in hope that process will continue but it seems there exist a bug in "Process Instance Detail" part of the admin console - it gives an error: "This operation cannot be completed without the selection of one or more operations from the list below!"
    We can try using 'Terminate' for this operation and probably several that follow (because they would probably stall without data from first terminated operation) in hope that process which runs in big user loop can arrive at a step where it can recover from all this using existing data but it's messy and doesn't always work.
    When the operation is in status Completed admin cannot do anything at all. This completed operation cannot be retried or terminated because selection box is grayed out. Process and data in it is irrecoverably lost and must be initiated from start.
    I must say we had large problems before if database connection is lost even for few seconds (intentional fail over from one db node to another) - but now, when we filled check-connection-sql in datasource configuration Livecycle is behaving a lot better but still with above problems.
    How can it happen that LC stops executing process workflow and stops on some operation just because it wasn't able to get valid db connection for several seconds? Is it some problem with transactions or what? What can I do? Where to look?
    We are still on LC ES2 SP3. JBoss on Windows Server 2003 and MSSQL 2005.
    Any help is appreciated.

    I would suggest you to contact the Adobe support so they can look further in system as well as LC database.

  • Problem with database connection in Jdev 11

    Hello,
    my jdev version is 11 and i want do really simple task create new database connection to my oracle db.
    I open database navigator and click new connection. i want jdbc connection but after i fill this form i pressed test connection button and get this error msg:
    Test failed: 4
    i think i have correct information but i tried this, i opened my older jdev 10 and copy jdbc url from my old db connection.
    In jdev 11 i checked Enter Custom JDBS Url and pasted url from jdev 10 and i get:
    Test failed: 4
    What is wrong?
    Thanks for your advice.
    J.

    I add new information:
    i cant connect to oracle db 8, but i try another db in my company which is 10 and its working fine.
    I write java class and try connect to db 8 via jdbc manually:
    String url = "jdbc:oracle:thin:@SERVER:1525:SID";
    String user = "user1";
    String password = "aaa";
    Class.forName("oracle.jdbc.driver.OracleDriver");
    // DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection(url, user, password);
    and i get this:
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
         at oracle.jdbc.driver.T4C8TTIdty.marshal(T4C8TTIdty.java:468)
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:339)
         at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:621)
         at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)
         at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:501)
         at java.sql.DriverManager.getConnection(DriverManager.java:525)
         at java.sql.DriverManager.getConnection(DriverManager.java:171)
         at project1.Class1.main(Class1.java:31)
    i hope this will be more usefull and i know i write this info about db's version little bit late.
    J.

  • Regarding web analysis database connections

    Hi All,
    I have couple of web analysis reports and the issue is i have copied this web analysis server to another server
    where i have the same application. Now iam trying to append those database connection properties of the file to
    point to the new server.
    I have altered by selecting the user>database>select database>rightclick>edit>changed properties
    But when i open the report it popping out with my old server details.
    Does any one have idea about how to change database properties for a report.
    Thanks,
    Ram

    Hi Manoj,
    I have created a DSN but how can i point the report to that DSN and run the same report as of my report running on my old server.
    Thanks,
    Ram

  • Query regarding Singletons and Database connection pool

    Hi there,
    I am trying to understand the Singleton pattern in relation to a pool of database connections.
    Frankly,I have not fully understood this.
    If my pool of database connections is set to 10, how can a singleton design come into this?
    In what way is this beneficial?
    Please can someone explain this?
    No offence meant

    bhuru_luthria wrote:
    Hi there,
    I am trying to understand the Singleton pattern in relation to a pool of database connections.They are related like a hiccup is related to a wiffle ball.

  • Problem with Database Connections in the designer - Catalog not updated

    This is Crystal Reports 2008 (12.2.0290). We have a number of reports that are viewed using the .Net runtime with the connection details set at runtime using ODBC to talk to SQL Server on different systems. This all works fine and is not the problem. The problem is when editing reports in the designer take the following example:
    Developer 1 creates report on their machine that references tables. DSN Name is DEV_DSN, pointing at their local database on their machine called DEV_DB1. Developer 2 needs to edit the report on their machine with a DSN of the same name (DEV_DSN) but this points to a different database on developer 2's machine called DEV_DB2.
    Developer 2 goes to the Set Datasource Location option in the Database menu to get it to point at their local DB only it doesn't work. They click on the first table included  (or the connection name) in the report and click update - they are prompted for the logon details for their local DSN/DB and supply them but they see an error indicating that there is an "Invalid object name" because the table is still being prefixed with the database name from developer 1's machine. When the table is expanded in this view the Catalog still shows as the DB name from developer 1's machine despite the connection properties above correctly showing the local DB name.
    As I say this is a design time issue not a runtime issue.
    Any ideas? Is there any way we can edit the Catalog name manually?

    Try setting the Over ridden qualified Table Name
    Set Datasource - > Tablename -> Properties
    Double click Over ridden qualified Table Name, type name as shown in in the table name field above it.
    Repeat for each table, this removes schema and db names associated with Table. Take a look at the SQL and make sure all tables are no longer prefixed.
    Report should now be totally portable.
    Ian

  • Some problems about database connection

    I am working on oracle9i. The problem is that I have to specify the "host string" in the login window of SQL*PLUS to connect to database (I can't use the command-line GUI). But I don't know how to specify "Host String" in JDBC connection string and SQL*Loader.
    Can anybody help me?

    Chen, please state specifically where you are trying to run each of these application from and where the database is.
    Since you mentioned a SQLPlus window then it sounds like you are running from a client PC to a remote Oracle installation. If this is true you normally use the connect string alias set up in the local tnsnames.ora file to connect to the remote db. You set this up as part of the client install or using the Net Configuration Assistent or some shops provide one common file on the network referenced by the TNS_ADMIN OS environment variable.
    For batch or command line usage
    sqlldr userid@service_name
    sqlplus userid@servie_name
    HTH -- Mark D Powell --

  • Problems with Database connection from a servlet

    Hi everybody:
    I got the following message:
    java.lang.ClassNotFoundException: weblogic/jdbc/oci/Driver
    when I try to connect to a Database.
    public Connection getConnection()
    Connection con = null;
    Driver myDriver = null;
    try
    Properties props = new Properties();
    props.put("user", "fangc");
    props.put("password", "fangc");
    myDriver = (Driver) Class.forName("weblogic.jdbc.oci.Driver").newInstance();
    con = myDriver.connect("jdbc:weblogic:oracle:occd01", props);
    catch(Exception e)
    System.out.println("Connection failed! - " e);
    finally
    return con;
    What am I doing wrong? I try the code without problem for a simple Java Client

    Cristina Fang wrote:
    >
    Hi everybody:
    I got the following message:
    java.lang.ClassNotFoundException: weblogic/jdbc/oci/DriverYou won't get that unless your code has:
    myDriver = (Driver) Class.forName("weblogic/jdbc/oci/Driver").newInstance();
    Make sure your servlet code is just like the right way that you have it
    below:
    myDriver = (Driver) Class.forName("weblogic.jdbc.oci.Driver").newInstance();
    Joe
    >
    when I try to connect to a Database.
    public Connection getConnection()
    Connection con = null;
    Driver myDriver = null;
    try
    Properties props = new Properties();
    props.put("user", "fangc");
    props.put("password", "fangc");
    myDriver = (Driver) Class.forName("weblogic.jdbc.oci.Driver").newInstance();
    con = myDriver.connect("jdbc:weblogic:oracle:occd01", props);
    catch(Exception e)
    System.out.println("Connection failed! - " e);
    finally
    return con;
    What am I doing wrong? I try the code without problem for a simple Java Client

  • Problem in database connection

    Dear sir,
    I am working on Netbeans 6.1
    I am creating 3 JFrames in same project but in different package each JFrame is having �Next� button and 3rd JFrame is having JTable
    And I am using simple Java Application but not the Java Desktop Application.
    Clicking on 1st JFrame �Next� button opens 2nd JFrame successfully
    Clicking on 2nd JFrame �Next� button opens 3rd JFrame successfully
    But When I connect to the 3rd JFrame�s JTable to Database by right-click>pop-menu>bind>elements>Import data froma and the run the project then
    I receive the errors in the output screen
    I am posting the code and below the code is errors which I receive in output screen,
    Please tell me the solution other than �Studying the tutorials� because I have already completed reading and it is not given in the tutorial how to use database application in the simple Java application but it is given for Java Desktop Application.
    Please tell me what to do for that ?
    Code for the 1st JFrame
    * one.java
    * Created on July 25, 2008, 9:55 PM
    package prac1;
    import prac2.two;
    * @author  Administrator
    public class one extends javax.swing.JFrame {
        /** Creates new form one */
        public one() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            jButton1 = new javax.swing.JButton();
            jLabel1 = new javax.swing.JLabel();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jButton1.setText("Next");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            jLabel1.setText("FIRST");
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap(213, Short.MAX_VALUE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(105, 105, 105))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addComponent(jLabel1)
                            .addGap(136, 136, 136))))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(59, 59, 59)
                    .addComponent(jLabel1)
                    .addGap(142, 142, 142)
                    .addComponent(jButton1)
                    .addContainerGap(62, Short.MAX_VALUE))
            pack();
        }// </editor-fold>
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    new two().setVisible(true);
    dispose();
        * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new one().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JLabel jLabel1;
        // End of variables declaration
    Code for the 2nd JFrame
    * two.java
    * Created on July 25, 2008, 9:56 PM
    package prac2;
    import prac3.three;
    * @author  Administrator
    public class two extends javax.swing.JFrame {
        /** Creates new form two */
        public two() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            jButton1 = new javax.swing.JButton();
            jLabel1 = new javax.swing.JLabel();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jButton1.setText("Next");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            jLabel1.setText("SECOND");
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap(209, Short.MAX_VALUE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(116, 116, 116))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addComponent(jLabel1)
                            .addGap(139, 139, 139))))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(43, 43, 43)
                    .addComponent(jLabel1)
                    .addGap(146, 146, 146)
                    .addComponent(jButton1)
                    .addContainerGap(74, Short.MAX_VALUE))
            pack();
        }// </editor-fold>
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    new three().setVisible(true);
    dispose();
        * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new two().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JLabel jLabel1;
        // End of variables declaration
    Code for the 3rd JFrame
    * two.java
    * Created on July 25, 2008, 9:56 PM
    package prac2;
    import prac3.three;
    * @author  Administrator
    public class two extends javax.swing.JFrame {
        /** Creates new form two */
        public two() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            jButton1 = new javax.swing.JButton();
            jLabel1 = new javax.swing.JLabel();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jButton1.setText("Next");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            jLabel1.setText("SECOND");
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap(209, Short.MAX_VALUE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(116, 116, 116))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addComponent(jLabel1)
                            .addGap(139, 139, 139))))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(43, 43, 43)
                    .addComponent(jLabel1)
                    .addGap(146, 146, 146)
                    .addComponent(jButton1)
                    .addContainerGap(74, Short.MAX_VALUE))
            pack();
        }// </editor-fold>
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    new three().setVisible(true);
    dispose();
        * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new two().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JLabel jLabel1;
        // End of variables declaration
    Errors which I receive in the output screen
    Exception in thread "AWT-EventQueue-0" Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "1" at line 1, column 80.
    Error Code: -1
    Call: SELECT Scholar_no, CARD_A, CARD_B, CARD_C, Grad_Year, CARD_D, Branch, BookBank 1, Name, BookBank 2 FROM LIB.student
    Query: ReportQuery(prac3.Student)
    at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:319)
    at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:566)
    at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:452)
    at oracle.toplink.essentials.threetier.ServerSession.executeCall(ServerSession.java:473)
    at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228)
    at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:214)
    at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:285)
    at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:615)
    at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2416)
    at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllReportQueryRows(ExpressionQueryMechanism.java:2382)
    at oracle.toplink.essentials.queryframework.ReportQuery.executeDatabaseQuery(ReportQuery.java:802)
    at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:628)
    at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:692)
    at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:746)
    at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2233)
    at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:952)
    at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:924)
    at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:367)
    at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.getResultList(EJBQueryImpl.java:478)
    at prac3.three.initComponents(three.java:32)
    at prac3.three.<init>(three.java:17)
    at prac2.two.jButton1ActionPerformed(two.java:71)
    at prac2.two.access$000(two.java:13)
    at prac2.two$1.actionPerformed(two.java:37)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:6041)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
    at java.awt.Component.processEvent(Component.java:5806)
    at java.awt.Container.processEvent(Container.java:2058)
    at java.awt.Component.dispatchEventImpl(Component.java:4413)
    at java.awt.Container.dispatchEventImpl(Container.java:2116)
    at java.awt.Component.dispatchEvent(Component.java:4243)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
    at java.awt.Container.dispatchEventImpl(Container.java:2102)
    at java.awt.Window.dispatchEventImpl(Window.java:2440)
    at java.awt.Component.dispatchEvent(Component.java:4243)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    Caused by: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "1" at line 1, column 80.
    at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
    at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
    at org.apache.derby.client.am.Connection.prepareStatement(Unknown Source)
    at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.prepareStatement(DatabaseAccessor.java:1162)
    at oracle.toplink.essentials.internal.databaseaccess.DatabaseCall.prepareStatement(DatabaseCall.java:612)
    at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:485)
    ... 47 more
    Caused by: org.apache.derby.client.am.SqlException: Syntax error: Encountered "1" at line 1, column 80.
    at org.apache.derby.client.am.Statement.completeSqlca(Unknown Source)
    at org.apache.derby.client.net.NetStatementReply.parsePrepareError(Unknown Source)
    at org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply(Unknown Source)
    at org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(Unknown Source)
    at org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(Unknown Source)
    at org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput_(Unknown Source)
    at org.apache.derby.client.am.Statement.readPrepareDescribeOutput(Unknown Source)
    at org.apache.derby.client.am.PreparedStatement.readPrepareDescribeInputOutput(Unknown Source)
    at org.apache.derby.client.am.PreparedStatement.flowPrepareDescribeInputOutput(Unknown Source)
    at org.apache.derby.client.am.PreparedStatement.prepare(Unknown Source)
    at org.apache.derby.client.am.Connection.prepareStatementX(Unknown Source)
    ... 51 more

    Hi here is the output which u requested.
    Services Summary...
    Service "Orcl" has 2 instance(s).
    Instance "Orcl", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:3 refused:0
    LOCAL SERVER
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:1 refused:0 state:ready
    LOCAL SERVER
    Service "orclXDB" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
    "D000" established:0 refused:0 current:0 max:1002 state:ready
    DISPATCHER <machine: SANJAY_KAUSHAL, pid: 2596>
    (ADDRESS=(PROTOCOL=tcp)(HOST=Sanjay_Kaushal)(PORT=1028))
    The command completed successfully

  • A problem about database connection

    What's the advantages and disadvantages of create each JDBC connection in the jspInit ( ) and close it in jspDestroy ( ) for every JSP script compare with from the connection pool.
    THANKS
    Edited by: Cryil on Nov 14, 2007 11:21 PM

    jiju wrote:
    The container calls the jspInit() to initialize te servlet instance.
    and is called only once for a servlet instance.
    so if we are opening JDBC conection in JspInit(), we will get only one connection.
    for the subsequent requests we have to use this single connection, results in starvation.
    where as in the case of connection pool ,we will get a pool of connections when the container starts
    we can make use of any of these available connections when we receive multiple requests.You can, normally, have multiple statements on the same connection, and since a JSP should only be reading (never updating) there won't be any (what I like to call) "commit cross-overs", so this is not "in principal" a problem.
    It would not, however, be ultimately practical. And the practice (a single connection per Servlet/Jsp) is still not one I would reccommend, for any reason.

  • Can any body identify my problem with database connection?

    My connection statement looks like this
    Class.forName(sun.jdbc.odbc.JdbcOdbcDriver);
    DriverManager.getConnection("jdbc:odbc:ram");
    Iam using jdk1.3 and oracle 9i client edition.
    The exception is .......
    java.sql.sqlexception: No suitable driver.
    The interesting thing is, with the same above connection statement , i am able to connect my core java program with oracle. But not with J2ee application.
    Can anybody resolve my prob?

    This is the thread where Guhan asked the same question:
    http://forum.java.sun.com/thread.jspa?threadID=5209455&tstart=50
    He's a classmate of the OP.
    If anyone thinks they can improve on this mess, please be my guest.
    %

  • DATABASE CONNECTIVITY PROBLEM IN JSP

    Hello Friends .
    I am facing problem in database connectivity with JSP . Following is the code .
    <%
    String accessDBURLPrefix = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
    String accessDBURLSuffix = ";DriverID=22;READONLY=false}";
    String databaseURL = accessDBURLPrefix + "db1.mdb" + accessDBURLSuffix;
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    java.sql.Connection con = java.sql.DriverManager.getConnection(databaseURL, "", "");
    out.println("Connection created sucessfully");
    catch(Exception e)
    out.println(e);
    %>
    It gives following output :
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Could not find file '(unknown)'.
    If I run the code in core java application then it works sucessfully .
    Plz help me to find the solution .
    I am using sun studio Enterprise 8.1
    have stored the access file in web direcotry in the project.
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Please use CODE tags when posting code. You are losing some of the plus signs of string concatenation to the forum's formatting beast.
    Preferred solution: Don't use Access as a database. The JDBC-ODBC bridge is always troublesome.
    If you must use Access...
    Well the message is easy enough to understand: it can't find the database db1.mdb.
    You say you put db1.mdb in the web directory. Obviously the computer is not looking there (silly computer for not looking where you put the file)
    So it is up to you to be smart and tell the computer exactly where to go.
    Using application.getRealPath("/db1.mdb") in place of "db1.mdb" will probably work in a JSP.
    String databaseURL = accessDBURLPrefix  + application.getRealPath("/db1.mdb") +  accessDBURLSuffix;cheers,
    evnafets

Maybe you are looking for

  • IF ELSE Statement in Member Formula

    I believe that I am in my final step of completing my database. But, I need to create a member formula that converts lbs to kg. I have gotten help on this question in the past and have a basic formula that works. However, I have 2 exceptions to the f

  • Can't power on Zen Nano Plus

    I have a Zen Nano Plus gb. The unit powered off so I replaced the battery as it was weak. Now it won't power up. I tested the batteries and tried different batteries. No help. The display blinks on and off at /4 second intervals. When I connect it to

  • Need 64 bit test for Win7/Vista

    I develop application which is required to be 64 bit and it hosts IWebBrowser - so   is also 64 bit. when I load html page to this control which contains flash, of cause I get problems, as there is no flash 64 bit activex. There is, however one solut

  • Error "Document splitting cannot find a distribution for currency type 00"

    Hi All, We are using ECC 6.0 version nAfter uploading a MT940 bank statement thru FF_5 we usually go to FEBA and check if there are any unposted items and we post them manually. And while doing so I am getting an error as "document splitting cannot f

  • Make Put/Get Alert Optional

    This is a suggestion for future Dreamweaver versions. If I am posting in the wrong forum, I apologize. I have Dreamweaver 8. I am the only user, and the only person who edits, puts, or gets files. My suggestion: Incorporate into Dreamweaver the optio