Error while connecting to Access Database

hi
i am making an application using Access Database using the following code
*try {*
*Connection conn=null;*
*Statement s=null;*
*ResultSet rs=null;*
    *Context ctx=new InitialContext();*
     *DataSource ds=(DataSource)ctx.lookup("jdbc/AccessDb");*
**     conn = ds.getConnection();**
**      s = conn.createStatement();**
*rs = s.executeQuery("select empname from stable");*
**      IPrivateApplic1View.IRsElement elm=null;**
**      while (rs.next())**
**          elm=wdContext.nodeRs().createRsElement();**
**          elm.setValue(rs.getString(1));**
**          wdContext.nodeRs().addElement(elm);**
**     } catch (Exception e) {**
**          wdComponentAPI.getMessageManager().reportSuccess(""+e);**
**          e.printStackTrace();**
but it is showing the error
*com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of AccessDb.*

Hi
refer
[Connecting to MS Access using receiver JDBC Adapter (Without DSN)|Connecting to MS Access using receiver JDBC Adapter (Without DSN)]
[/thread/147169 [original link is broken]|/thread/147169 [original link is broken]]
thanks
suresh

Similar Messages

  • Error while connecting to Access Database from Oracle

    Dear All,
    I'm trying to connect Oracle 9i to Access Database.
    but im getting the below error while executing query.
    ERROR at line 1:
    ORA-28545: error diagnosed by Net8 when connecting to an agent
    NCRO: Failed to make RSLV connection
    ORA-02063: preceding 2 lines from MYSQLi did the following thing through to connect the database.
    1) First i made odbc driver called ODBC1
    2) I create the following file on oracle server C:\oracle\ora9I\hs\admin\initodbc1.ora
    i edit the below thing in initodbc1.ora
    HS_FDS_CONNECT_INFO =ODBC1
    HS_FDS_TRACE_LEVEL = ON3) I made some changes in sqlnet.ora
    SQLNET.AUTHENTICATION_SERVICES= NONE
    before it was *NTS*4) Below are the entries in tnsnames.ora i changed the port from 1521 to 1522 cos 1521 already exists.
    ODBC1.TADAWI.LOC =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = admin-amc)(PORT = 1522))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = ODBC1)
    ODBC1.WORLD =
      (DESCRIPTION =
         (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.251) (PORT = 1522)
      (CONNECT_DATA =
          (SID = ODBC1)
      (HS=OK)
    )5) Listener file code
    ODBC1 =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = admin-amc)(PORT = 1522))
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = admin-amc)(PORT = 1521))
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC2))
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = PLSExtProc)
          (ORACLE_HOME = C:\oracle\ora9I)
          (PROGRAM = extproc)
        (SID_DESC =
          (GLOBAL_DBNAME = orcl)
          (ORACLE_HOME = C:\oracle\ora9I)
          (SID_NAME = orcl)
         (SID_DESC =
          (PROGRAM = hsodbc)
          (ORACLE_HOME = C:\oracle\ora9I)
          (SID_NAME = ODBC1)
      )6) after that i created
    SQL> CREATE DATABASE LINK MYSQL CONNECT TO XTRACK IDENTIFIED BY XTRACK USING 'ODBC1.WORLD'
    Database link created.7) Listener Status
    LSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 04-MAR-2012 21:26:16
    Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=admin-amc)(PORT=1521)))
    STATUS of the LISTENER
    Alias                     LISTENER
    Version                   TNSLSNR for 32-bit Windows: Version 9.2.0.1.0 - Production
    Start Date                04-MAR-2012 20:52:33
    Uptime                    0 days 0 hr. 33 min. 44 sec
    Trace Level               off
    Security                  OFF
    SNMP                      OFF
    Listener Parameter File   C:\oracle\ora9I\network\admin\listener.ora
    Listener Log File         C:\oracle\ora9I\network\log\listener.log
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=admin-amc.tadawi.loc)(PORT=1521)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC2ipc)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=admin-amc.tadawi.loc)(PORT=8080))(Presentation=HTTP)(Session=RAW))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=admin-amc.tadawi.loc)(PORT=2100))(Presentation=FTP)(Session=RAW))
    Services Summary...
    Service "ODBC1" has 1 instance(s).
      Instance "ODBC1", status UNKNOWN, has 1 handler(s) for this service...
    Service "PLSExtProc" has 1 instance(s).
      Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "orcl" has 2 instance(s).
      Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
      Instance "orcl", status READY, has 1 handler(s) for this service...
    Service "orclXDB" has 1 instance(s).
      Instance "orcl", status READY, has 1 handler(s) for this service...
    The command completed successfullyi did exactly what documentation says and it will not through any error but atlast when i try to access the access database tables it give me the below error
    SELECT * FROM DBO_COMPANY@MYSQL
    ERROR at line 1:
    ORA-28545: error diagnosed by Net8 when connecting to an agent
    NCRO: Failed to make RSLV connection
    ORA-02063: preceding 2 lines from MYSQLi'm using Oracle9i Enterprise Edition Release 9.2.0.1.0 any help will appreciate.
    Regards
    Moazam
    Edited by: Moazam Shareef on Mar 4, 2012 10:25 AM

    first of all thanks for your support Mr. Kgronau
    I did what u said but still its giving me below error.
    SQL> SELECT * FROM DBO_PATINS@MYSQL
      2  ;
    SELECT * FROM DBO_PATINS@MYSQL
    ERROR at line 1:
    ORA-12154: TNS:could not resolve service namei re-check the service, and restart the listener as you said below are the logs could you help me to solve this issue plz.
    TNSNAMES.ORA
    # TNSNAMES.ORA Network Configuration File: C:\oracle\ora9I\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    ORCL.TADAWI.LOC =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = admin-amc)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = orcl)
    ODBC1 =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = admin-amc)(PORT = 1522))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = ODBC1)
    INST1_HTTP.TADAWI.LOC =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = admin-amc)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = SHARED)
          (SERVICE_NAME = MODOSE)
          (PRESENTATION = http://HRService)
    EXTPROC_CONNECTION_DATA.TADAWI.LOC =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC2))
        (CONNECT_DATA =
          (SID = PLSExtProc)
          (PRESENTATION = RO)
      )LISTENER.ORA
    # LISTENER.ORA Network Configuration File: C:\oracle\ora9I\NETWORK\ADMIN\listener.ora
    # Generated by Oracle configuration tools.
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = TCP)(HOST = admin-amc)(PORT = 1521))
          (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC2))
    ODBC1 =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = TCP)(HOST = admin-amc)(PORT = 1522))
    SID_LIST_ODBC1 =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = ODBC1)
          (ORACLE_HOME = C:\oracle\ora9I)
          (PROGRAM = hsodbc)
        (SID_DESC =
          (GLOBAL_DBNAME = ODBC1)
          (ORACLE_HOME = C:\oracle\ora9I)
          (SID_NAME = ODBC1)
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = PLSExtProc)
          (ORACLE_HOME = C:\oracle\ora9I)
          (PROGRAM = extproc)
        (SID_DESC =
          (GLOBAL_DBNAME = orcl)
          (ORACLE_HOME = C:\oracle\ora9I)
          (SID_NAME = orcl)
      )then i restart both listener entries (ie lsnrctl start ODBC1 and lsnrctl start ) and both are running fine without any error below are the status.
    LSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 05-MAR-2012 18:42:09
    Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=admin-amc)(PORT=1521)))
    STATUS of the LISTENER
    Alias                     LISTENER
    Version                   TNSLSNR for 32-bit Windows: Version 9.2.0.1.0 - Production
    Start Date                05-MAR-2012 18:32:15
    Uptime                    0 days 0 hr. 9 min. 56 sec
    Trace Level               off
    Security                  OFF
    SNMP                      OFF
    Listener Parameter File   C:\oracle\ora9I\network\admin\listener.ora
    Listener Log File         C:\oracle\ora9I\network\log\listener.log
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=admin-amc.tadawi.loc)(PORT=1521)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC2ipc)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=admin-amc.tadawi.loc)(PORT=8080))(Presentation=HTTP)(Session=RAW))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=admin-amc.tadawi.loc)(PORT=2100))(Presentation=FTP)(Session=RAW))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
      Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "orcl" has 2 instance(s).
      Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
      Instance "orcl", status READY, has 1 handler(s) for this service...
    Service "orclXDB" has 1 instance(s).
      Instance "orcl", status READY, has 1 handler(s) for this service...
    The command completed successfullyLISTENER.ORA ODBC1 status
    LSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 05-MAR-2012 18:41:52
    Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=admin-amc)(PORT=1522)))
    STATUS of the LISTENER
    Alias                     ODBC1
    Version                   TNSLSNR for 32-bit Windows: Version 9.2.0.1.0 - Production
    Start Date                05-MAR-2012 18:32:08
    Uptime                    0 days 0 hr. 9 min. 46 sec
    Trace Level               off
    Security                  OFF
    SNMP                      OFF
    Listener Parameter File   C:\oracle\ora9I\network\admin\listener.ora
    Listener Log File         C:\oracle\ora9I\network\log\odbc1.log
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=admin-amc.tadawi.loc)(PORT=1522)))
    Services Summary...
    Service "ODBC1" has 1 instance(s).
      Instance "ODBC1", status UNKNOWN, has 2 handler(s) for this service...
    The command completed successfullyWhere hope i'm near to retrive the access data.
    Regards
    Moazam

  • Could not find file ERROR while connecting to access (mdb) file

    I am getting the following error while connecting to the database:
    javax.servlet.ServletException: [Microsoft][ODBC Microsoft Access Driver] Could not find file 'C:\WINNT\system32\Database1.mdb'.
    Following is my code:
    <%
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         String database="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
         String filename="D://BeaTemp//Database1";
         database+= filename.trim() + ";DriverID=22;READONLY=true}";
         Connection con=DriverManager.getConnection(database, "", "");
         Statement st=con.createStatement();
         ResultSet rs=st.executeQuery("select * from Database1.Employee");
         ResultSetMetaData rsmd=rs.getMetaData();
         while(rs.next()){
              for(int i=1;i<=rsmd.getColumnCount();i++) {
                   out.println(rs.getString(i));
    %>
    What could be the problem..??
    Thankx in advance..
    Satish.

    Got the solution.
    The statement:
    ResultSet rs=st.executeQuery("select * from Database1.Employee");
    should be changed as:
    ResultSet rs=st.executeQuery("select * from Employee");
    Now, it is working fine.
    Regards,
    Satish.

  • Error while connecting to the database from a JSP Page

    Hi,
    I am using a simple JSP page which is based on the sample JSP pages from OTN.
    When I try to connect to my database using the following code:
    InitialContext ic = new InitialContext();
    OracleDataSource ds = (OracleDataSource)ic.lookup("jdbc/OTN9iDS");
    m_connection = ds.getConnection();
    I get the following error:
    Naming exception Error while connecting to the database : javax.naming.NameNotFoundException: jdbc/OTN9iDS not found in JDBCTest-JDBCTestProject-webapp
    Does anybody know wht this is happening?
    Any help would be appreciated
    FRank

    Hi Frank,
    Are you using standalone OC4J or 9iAS ? If you are using standalone OC4J then you need to add a proper data source entry in %OC4J_HOME%j2ee\home\config\data-sources.xml file.
    If you are using 9iAS the you can log in to the Enterprise Manager console and add the data source entry by using wizard provided by 9iAS.
    Ensure the case of the JNDI lookup string, since, it is case sensitive.
    Hope this helps.
    Abhijeet

  • Error while connecting to  Auxiliary Database

    Hi
    I am practicing Cloning the database on my Personal Computer. I am following the steps outlined here
    http://www.oracle-base.com/articles/9i/DuplicateDatabaseUsingRMAN9i.php
    But while connecting to Auxiliary database I get this error.
    RMAN - 04006 Error from auxiliary database: ORA 12514 TNS: listener does not currently know of service requested in connect descriptor
    RMAN - 00554 initialization of internal recovery manager package failed...
    what is the solution for this?
    This is 10g database and my PC has Opensuse 11 OS
    I think the problem is in configuring listener. But I am following the instructions given in that page....

    You probably skipped this part
    Next add the appropriate entries into the tnsnames.ora and listener.ora files in the $ORACLE_HOME/network/admin directory. Remember to load the new configuration into the listener:
    Which is why you are getting the error. The database needs to register itself with the listener. This doesn't happen in nomount mode.
    Other than that: there is an option in database control to duplicate a database in 10g. Using that you only need to hit buttons. Why are you using 9i code and policies?
    Sybrand Bakker
    Senior Oracle DBA

  • Failed to Generate Wrapper Class exception while connecting to access database.

    i tried to connect to access database in windows. i made a user dsn in windows
    control panel and added this to the connection pool. after which i created a JDBC
    datasource using this connection pool.(specifying the driver as sun.jdbc.odbc.JdbcOdbcDriver
    and url=jdbc:odbc:xyz
    where xyz is the user dsn name pointing to the relevant access database file.
    on testing this in the weblogic admin console it showed successful operation.
    when i tried to use this connection pool in weblogic 8.1 workshop and tried
    building a rowset control to check the connectivity it gave the following exception.
    file attached.
    any hints on how to get it working/ how to use access database with wl 8.1
    workshop.
    Exception in context_onAcquire
    java.sql.SQLException: Failed to Generate Wrapper Class.
    Nested Exception: java.lang.RuntimeException: Failed to Generate Wrapper Class
    at weblogic.utils.wrapper.WrapperFactory.createWrapper(WrapperFactory.java:141)
    [DB-error.txt]

    ashok wrote:
    i tried to connect to access database in windows. i made a user dsn in windows
    control panel and added this to the connection pool. after which i created a JDBC
    datasource using this connection pool.(specifying the driver as sun.jdbc.odbc.JdbcOdbcDriver
    and url=jdbc:odbc:xyz
    where xyz is the user dsn name pointing to the relevant access database file.
    on testing this in the weblogic admin console it showed successful operation.
    when i tried to use this connection pool in weblogic 8.1 workshop and tried
    building a rowset control to check the connectivity it gave the following exception.
    file attached.
    any hints on how to get it working/ how to use access database with wl 8.1
    workshop.
    Exception in context_onAcquire
    java.sql.SQLException: Failed to Generate Wrapper Class.
    Nested Exception: java.lang.RuntimeException: Failed to Generate Wrapper Class
    at weblogic.utils.wrapper.WrapperFactory.createWrapper(WrapperFactory.java:141)
    Hi Askok. This exception usually means that the weblogic server's environment
    doesn't have all it needs to make the jdbc connection you want. You should
    ensure that the OS environment variable PATH has all the libraries you need
    for making a jdbc-odbc connection, and that it's classpath also contains the
    driver you want.
    What DBMS are you connecting to? The reason I ask is because if there is a
    pure JDBC driver for it, that will be preferable, because the jdbc-odbc bridge
    from Sun is not threadsafe, so it can corrupt Weblogic.
    Joe
    >
    Exception in context_onAcquire
    java.sql.SQLException: Failed to Generate Wrapper Class.
    Nested Exception: java.lang.RuntimeException: Failed to Generate Wrapper Class
    at weblogic.utils.wrapper.WrapperFactory.createWrapper(WrapperFactory.java:141)
    at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactory.java:73)
    at weblogic.jdbc.jts.Driver.newConnection(Driver.java:674)
    at weblogic.jdbc.jts.Driver.createLocalConnection(Driver.java:196)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:154)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:298)
    at com.bea.wlw.runtime.core.control.DatabaseControlImpl.getConnection(DatabaseControlImpl.jcs:1360)
    at com.bea.wlw.runtime.core.control.DatabaseControlImpl.context_onAcquire(DatabaseControlImpl.jcs:1252)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:353)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:420)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:393)
    at com.bea.wlw.runtime.core.container.Invocable.fireEvent(Invocable.java:603)
    at com.bea.wlw.runtime.core.context.WlwThreadContext.sendEvent(WlwThreadContext.java:989)
    at com.bea.wlw.runtime.core.context.WlwThreadContext.raiseEvent(WlwThreadContext.java:919)
    at com.bea.wlw.runtime.core.container.Container.raiseContextEvent(Container.java:553)
    at com.bea.wlw.runtime.jcs.container.JcsContainer.onAcquire(JcsContainer.java:513)
    at sun.reflect.GeneratedMethodAccessor325.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:353)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:420)
    at com.bea.wlw.runtime.core.container.Invocable.sendContextEvent(Invocable.java:524)
    at com.bea.wlw.runtime.jcs.container.JcsContainer.sendContextEvent(JcsContainer.java:464)
    at com.bea.wlw.runtime.core.context.WlwThreadContext.acquireResources(WlwThreadContext.java:676)
    at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:307)
    at processes.Audit.insertAuditData(Audit.ctrl)
    at processes.ExceptionHandler.auditInsertAuditData(ExceptionHandler.jpd:78)

  • "Connection is closed" closed error while using MS Access database

    We are using MS Access database in our project. Recently the database was upgraded to 2000.
    After upgrading the database, I get the folowing error when getAutoCommit() is called on a connection -
    java.sql.SQLException: Connection is closed
         at sun.jdbc.odbc.JdbcOdbcConnection.validateConnection(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbcConnection.getAutoCommit(Unknown Source)
    The connection is not closed explicity before getAutoCommit() is called, only the statement is closed.
    This error is sporadic and occurs under load scenario only (when a lot of connections are open). Once the error occurs, all the database calls fail then onwards. The error was not occuring before the database was upgraded.
    I suspect the jbdc-odbc driver. The driver might not be compatible with Access2000 database. Under load scenario, it might be closing connections automatically.
    Has anybody faced similar problem before? Where can I find the compatible jdbc-odbc driver? And how to ensure that it is jdbc-odbc driver problem only?
    The database verison - MS Access 2000
    Java version - 1.3.1_01

    can i just point out that there is no support for transactions in Access so I wonder why you are calling autoCommit methods at all...

  • Column Not found error while trying to access database through JSP+Java Bea

    I am trying to access MS Access 2003 db through JSP using Tomcat 5.0.28.The code for accessing the database is incorporated in the bean.The JSP only calls the particular method of the bean .
    Code for Java Bean:
    package ActiveViewer;
    import java.sql.*;
    import java.util.*;
    public class CompanyBean
    Connection con;
    ResultSet rs=null;
    Statement st;
    public CompanyBean(){}
    public void connect()
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("Here4");
    con=DriverManager.getConnection("jdbc:odbc:activeviewer","","");
    System.out.println("Here1");
    catch (ClassNotFoundException e)
    System.out.println("Could not locate driver.");
    catch (SQLException e)
    System.out.println("An SQL Exception has occured :: "+e);
    e.printStackTrace();
    catch (Exception e)
    System.out.println("An unknown Exception has occured :: "+e);
    e.printStackTrace();
    public void disconnect()
    try
    if (con!=null)
    con.close();
    catch (SQLException e)
    System.out.println("An SQL Exception has occured :: "+e);
    e.printStackTrace();
    public ResultSet select(String username)
    if(con!=null)
    try
    st=con.createStatement();
    rs=st.executeQuery("select * from company where username='" + username + "'");
    catch (SQLException e)
    System.out.println("An SQL Exception has occured :: "+e);
    e.printStackTrace();
    catch (Exception e)
    System.out.println("An Exception has occured while retrieving :: "+e);
    e.printStackTrace();
    else
    System.out.println("Connection to database was lost.");
    return rs;
    The code for JSP that uses the above bean is:
    <%@ page language="java" import="java.sql.*,ActiveViewer.* " contentType="text/html"%>
    <jsp:useBean id="conn" scope="session" class="ActiveViewer.CompanyBean" />
    <html>
    <body>
    <% String username=request.getParameter("username");
    String password=request.getParameter("password");
    System.out.println("username:"+username);
    System.out.println("password:"+password);
    conn.connect();
    ResultSet rs=conn.select(username);
    System.out.println("Below select ");
    while (rs.next())
    String dbusername=rs.getString("username");
    String dbpassword=rs.getString("password");
    if(dbusername.equals(username) && dbpassword.equals (password))
    { %> out.println("OK");
    <% }
    else { %>Invalid Username and / or Password.
    <br>Clickhere to go back to Login Page.
    <% }
    } %>
    </body>
    </html>
    I get the following error:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Column not found
    though the database is not int he same folder as the jsp, the DSN is set correctly to pint to the db location.The jsp does print in stdout file:
    Here4 (from connect method above)
    Here 1 (from connect method above)
    Below Select (from jsp)
    This means that the jsp does connect to db but it gives the above error.Also the field name also matches that in the database and data is present in the db too.
    All other things like creating package for bean in WEB-INF/classes,incorporating the packakage are done.
    Can someone please help me with their precious advice?

    Hi, I too have a problem with an SQL exception, the message is Column not found.
    I'm using the sun jdbc odbc driver with access.
    the first few lines of the stack trace are
    sun.jdbc.odbc.JdbcOdbcResultSet.findColumn(JdbcOdbcResultSet.java:1852)
    sun.jdbc.odbc.JdbcOdbcResultSet.getInt(JdbcOdbcResultSet.java:603)
    net.homeip.sdaniels.MemberBean.ejbFindByUnamePwd(MemberBean.java:127)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    I am of course sure that the column does infact exist. I can insert into the column no problems. the sql looks like this:
    SELECT * FROM Members WHERE uName ='Stewart' AND encPwd='�F2C�3����h�1Y�'
    Can any one tell me if there is a common cause to this problem?
    Thanks

  • ERROR while connecting to Netezza Database from oracle 10g via dblink.

    Gurus,
    We are trying to connect to Netezza DB from oracle 10g DB.. We successfully establised ODBC connection but unable to retrieve data over the dblink connected from oracle to Netezza. We get this error.. Please HELP ASAP!!!!!!!!
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    Server and/or port attributes are empty {HY000,NativeErr = 33}

    Manik wrote:
    We are trying to connect to Netezza DB from oracle 10g DB.. We successfully establised ODBC connection but unable to retrieve data over the dblink connected from oracle to Netezza. We get this error.. Please HELP ASAP!!!!!!!!
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    Server and/or port attributes are empty {HY000,NativeErr = 33}Always test ODBC client connectivity on the Oracle server to the remote and foreign database, first. Use the isql ODBC client command line interface (as the oracle or grid o/s user).
    If this does not work, then Oracle HSO will also not work.
    Once you have confirmed that this is working, then configure the HSO service for Oracle.
    If that fails, enables ODBC client tracing for that HSO service (in the init file for that service) to see exactly what ODBC calls Oracle is making and which of these are failing.

  • Error while connecting to Cloudscape Database

    Hi All,
    I am working on Sun's reference implementation App Server verson 1.3.1. It comes shipped with cloudscape database. When I write try to connect to this App Server through JSP that calls methods through Enterprise Java Beans I get this Error Message:
    java.net.ConnectException: Connection refused: connect
    java.rmi.RemoteException: nested exception is: javax.ejb.EJBException: Unable to
    connect to database. Connection refused to host: XXXXXXXX; nested exception
    is:
    java.net.ConnectException: Connection refused: connect; nested exception
    is:
    javax.ejb.EJBException: Unable to connect to database. Connection refuse
    d to host: XXXXXXXXX; nested exception is:
    java.net.ConnectException: Connection refused: connect
    javax.ejb.EJBException: Unable to connect to database. Connection refused to hos
    t: XXXXXXXXX; nested exception is:
    java.net.ConnectException: Connection refused: connect
    <<no stack trace available>>
    Can any one help me solve this problem.
    Regards,
    Venky.

    Have you started the database?
    []s
    Michael

  • Java == error while connecting to mysql database?!?!??!

    Hi. I'm using Eclipse to develope jsp pages. I'm new to java.
    I'm trying to connect from a jsp page to mysql server and i'm getting an error on the line below:
    Class.forName("com.mysql.jdbc.Driver");
    Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    i downloaded the mysql jar file and i added it to my library folder.
    the other question is that is there anyway to mention the name of the database in my connection?
    conn =DriverManager.getConnection("jdbc:mysql://localhost","admin", "");

    hi this is the root cause i thought it might help
    root cause
    javax.servlet.ServletException: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
         org.apache.jsp.test_jsp._jspService(test_jsp.java:100)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:128)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
         java.lang.ClassLoader.loadClassInternal(Unknown Source)
         java.lang.Class.forName0(Native Method)
         java.lang.Class.forName(Unknown Source)
         org.apache.jsp.test_jsp._jspService(test_jsp.java:85)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

  • I was facing problem while connecting to oracle database.Can some one help me soon!!!!!

    Hi all,
    I was facing problem from last week.Suddenly i was getting ora-12505 error while connecting to the database through toad.I tried to change tnsnames.ora & listener.ora in multiple ways,but no luck...Inspite i was getting different errors like ora - 01034: ORACLE not available / ora - 27101: shared memory realm does not exist...When i try to connect using sys / sys as sysdba,connection is establishing and when issue the command startup it was throwing the error ORA-01821: date format not recognized......Fed up solving these issues....Can some one help me out...It's very very urgent..
    Thanks in advance,
    pavankumar.

    Well, the obviously solution is to use separate Apple ID's for iCloud.

  • Getting "ORA-12514 error" while connecting first time

    Hi,
    Getting below error while connecting to the database first time.
    ORA-12514: TNS:listener does not currently know of service requested in connect
    apludc01dat25:e2cmpc1 > tnsping ora37_ap
    TNS Ping Utility for Linux: Version 10.2.0.5.0 - Production on 26-MAR-2012 12:00:58
    Copyright (c) 1997, 2010, Oracle. All rights reserved.
    Used parameter files:
    /grid/product/crs/network/admin/sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = apl11764clu01-scan-oravip.nat.bt.com)(PORT = 61901)) (CONNECT_DATA = (SERVICE_NAME = ORA37_ap))
    OK (0 msec)
    apludc01dat25:e2cmpc1 > sqlplus
    SQL*Plus: Release 10.2.0.5.0 - Production on Mon Mar 26 12:00:15 2012
    Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
    Enter user-name: outln@ora37_ap
    Enter password:
    ERROR:
    ORA-12514: TNS:listener does not currently know of service requested in connect
    descriptor
    Enter user-name:
    apludc01dat25:e2cmpc1 > sqlplus
    SQL*Plus: Release 10.2.0.5.0 - Production on Mon Mar 26 12:00:22 2012
    Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
    Enter user-name: outln@ora37_ap
    Enter password:
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    SQL>
    Please help me out to resolve this issue.
    Thank you.
    Regards,
    Dasarath

    Hi,
    We are getting this error while connecting remotely.
    PFB output of listener status and services
    apl11764a001:ORA37a > lsnrctl services LISTENER_ORA37
    LSNRCTL for Linux: Version 11.1.0.7.0 - Production on 26-MAR-2012 12:18:06
    Copyright (c) 1991, 2008, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_ORA37)))
    Services Summary...
    Service "ORA37_ap" has 1 instance(s).
    Instance "ORA37a", status READY, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:2 refused:0 state:ready
    LOCAL SERVER
    Service "ORA37_ap_XPT" has 1 instance(s).
    Instance "ORA37a", status READY, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:2 refused:0 state:ready
    LOCAL SERVER
    Service "ORA37aXDB" has 1 instance(s).
    Instance "ORA37a", status READY, has 1 handler(s) for this service...
    Handler(s):
    "D000" established:0 refused:0 current:0 max:1022 state:ready
    DISPATCHER <machine: apl11764a001, pid: 25970>
    (ADDRESS=(PROTOCOL=tcp)(HOST=apl11764a001)(PORT=10862))
    The command completed successfully
    apl11764a001:ORA37a > lsnrctl status LISTENER_ORA37
    LSNRCTL for Linux: Version 11.1.0.7.0 - Production on 26-MAR-2012 12:18:20
    Copyright (c) 1991, 2008, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_ORA37)))
    STATUS of the LISTENER
    Alias LISTENER_ORA37
    Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
    Start Date 26-MAR-2012 12:15:17
    Uptime 0 days 0 hr. 3 min. 2 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File /grid/product/crs/network/admin/listener.ora
    Listener Log File /grid/product/crs/log/diag/tnslsnr/apl11764a001/listener_ora37/alert/log.xml
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_ORA37)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.25.169.4)(PORT=62037)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.25.169.7)(PORT=62037)))
    Services Summary...
    Service "ORA37_ap" has 1 instance(s).
    Instance "ORA37a", status READY, has 1 handler(s) for this service...
    Service "ORA37_ap_XPT" has 1 instance(s).
    Instance "ORA37a", status READY, has 1 handler(s) for this service...
    Service "ORA37aXDB" has 1 instance(s).
    Instance "ORA37a", status READY, has 1 handler(s) for this service...
    The command completed successfully
    Thank you.
    Regards,
    Dasarath

  • Error while connecting MYSQL Database

    Hi,
    I use a 30 days trial of Crystal Reports 2008. When i try to connect with the database i always get the next error: [http://www.visiscan.nl/error.jpg]
    The database is 4.1GB large and there is 10GB free space on the database.
    Anybody can tell me what to do?

    Hi Tom,
    As I understand the error while connecting to database is
    u201CFailed to retrieve data from databaseu201D
    There could be some could be multiple reasons for this.
    If you are using an ODBC connection then try to check the DSN. Recreate the same and then try.
    If the database is oracle check if native client is installed and try to ping from the native client to check if it responds.
    When connecting to Oracle, ensure that the Service name is identical to that used in the <ORA_HOME>/network/admin/tnsnames.ora file on the BusinessObjects XI Release 2 server.
    For ODBC databases, ensure that the ODBC DSN is exactly the same in the ODBC Manager as on the BusinessObjects XI Release 2 server.
    Please let us know if this helps
    Regards,
    Aditya Joshi

  • Error while connecting to Database after Database upgradation

    Hi All,
    I installed and worked with BAM and used Oracle Database 9i previously. After the Database
    was upgraded to 10g (10.2.0.4.0 which is compatible for BAM), I am trying to ReInstall BAM
    which is throwing me an error.
    It accepts the Database Login Information but at the step of building Repository for
    Enterprise Link it gives up the following error:
    ' A connection with the database cannot be made '
    Can anyone please help me to figure out this one.
    Thanks,
    Vishal

    Hi,
    I also have the same problem.Could you plz tell us what configuration I need to add in tnsnames.ora file.
    content of my tnsnames.ora file is below
    # tnsnames.ora Network Configuration File: C:\DevSuiteHome_2\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = Rahul-PC)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = PLSExtProc)
    )

Maybe you are looking for