Jdbc:odbc:MSAccess Error

Hi All,
I am trying to establish a link to my access database (easy enough u would think!!!) via sun.jdbc.odbc.JdbcOdbcDriver and i get this really horrible error message :-
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D36
Function=[Unknown.]
Library=C:\Program Files\Java\j2re1.4.0\bin\client\jvm.dll
NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possi
reason and solutions.
Current Java thread:
at sun.jdbc.odbc.JdbcOdbc.setStmtAttrPtr(Native Method)
at sun.jdbc.odbc.JdbcOdbc.SQLSetStmtAttrPtr(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.setRowStatusPtr(Unknown S
at sun.jdbc.odbc.JdbcOdbcResultSet.initialize(Unknown Source
at sun.jdbc.odbc.JdbcOdbcStatement.getResultSet(Unknown Sour
- locked <02A7D658> (a sun.jdbc.odbc.JdbcOdbcStatement)
at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(Unknown Sour
at testPSConnection.main(testPSConnection.java:47)
Dynamic libraries:
0x00400000 - 0x00406000 C:\WINNT\system32\java.exe
0x77F80000 - 0x77FFB000 C:\WINNT\System32\ntdll.dll
0x77DB0000 - 0x77E0B000 C:\WINNT\system32\ADVAPI32.dll
0x77E80000 - 0x77F35000 C:\WINNT\system32\KERNEL32.DLL
0x77D40000 - 0x77DB0000 C:\WINNT\system32\RPCRT4.DLL
0x78000000 - 0x78046000 C:\WINNT\system32\MSVCRT.dll
0x6D330000 - 0x6D445000 C:\Program Files\Java\j2re1.4.0\bin\
ll
0x77E10000 - 0x77E74000 C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7C000 C:\WINNT\system32\GDI32.DLL
0x77570000 - 0x775A0000 C:\WINNT\system32\WINMM.dll
0x6D1D0000 - 0x6D1D7000 C:\Program Files\Java\j2re1.4.0\bin\
0x6D300000 - 0x6D30D000 C:\Program Files\Java\j2re1.4.0\bin\
0x6D210000 - 0x6D228000 C:\Program Files\Java\j2re1.4.0\bin\
0x6D320000 - 0x6D32D000 C:\Program Files\Java\j2re1.4.0\bin\
0x6D250000 - 0x6D25A000 C:\Program Files\Java\j2re1.4.0\bin\
0x1F7B0000 - 0x1F7E1000 C:\WINNT\system32\ODBC32.dll
0x71780000 - 0x7180A000 C:\WINNT\system32\COMCTL32.dll
0x76B30000 - 0x76B6E000 C:\WINNT\system32\comdlg32.dll
0x70BD0000 - 0x70C34000 C:\WINNT\system32\SHLWAPI.DLL
0x782F0000 - 0x78532000 C:\WINNT\system32\SHELL32.DLL
0x1F850000 - 0x1F866000 C:\WINNT\system32\odbcint.dll
0x1F8F0000 - 0x1F932000 C:\WINNT\System32\odbcjt32.dll
0x1B000000 - 0x1B16F000 C:\WINNT\System32\msjet40.dll
0x1B5C0000 - 0x1B655000 C:\WINNT\System32\mswstr10.dll
0x77A50000 - 0x77B46000 C:\WINNT\system32\ole32.dll
0x779B0000 - 0x77A4B000 C:\WINNT\system32\OLEAUT32.dll
0x1F8E0000 - 0x1F8EE000 C:\WINNT\System32\odbcji32.dll
0x1B2C0000 - 0x1B2CD000 C:\WINNT\System32\msjter40.dll
0x1B2D0000 - 0x1B2F6000 C:\WINNT\System32\MSJINT40.DLL
0x775A0000 - 0x77625000 C:\WINNT\system32\CLBCATQ.DLL
0x1B7F0000 - 0x1B82A000 C:\WINNT\System32\msjtes40.dll
0x10750000 - 0x1075B000 C:\WINNT\system32\VBAJET32.DLL
0x10B70000 - 0x10BD2000 C:\WINNT\system32\expsrv.dll
0x77920000 - 0x77943000 C:\WINNT\system32\imagehlp.dll
0x72A00000 - 0x72A2D000 C:\WINNT\system32\DBGHELP.dll
0x690A0000 - 0x690AB000 C:\WINNT\system32\PSAPI.DLL
Local Time = Tue Feb 18 04:29:58 2003
Elapsed Time = 0
# HotSpot Virtual Machine Error : EXCEPTION_ACCESS_VIOLATION
# Error ID : 4F530E43505002D5
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
# Java VM: Java HotSpot(TM) Client VM (1.4.0_01-b03 mixed mode)
# An error report file has been saved as hs_err_pid1380.log.
# Please refer to the file for further information.
I know the code is ok,
i am running this on win2k with java 1.3 and java1.4.0_01 run time,
Any ideas would be very gratefully recieved.
Thanks in advance..
Sajid

actually i got this working by downloading the latest sdk for java
j2se 4.01.
So if anyone has a similar problem, thats what you should do!!!
I think there was a problem with the hotspot runtime environment before, but its all sorted now.

Similar Messages

  • Jdbc-odbc java error using SQL adapter in o9iASWireless

    I've used the SQL adapter in the previous releases of wireless without any problem. Most of the time I would use it for all the wireless PLSQL applications in the Oracle database and it works very OK.
    I have also used it to connect with a SQLserver database to try out some queries. In this case I would use the standard JDBC/ODBC bridge driver from SUN.
    In release 2.0 I can't connect with this SQL Server database anymore.
    I've added a system DSN to the ODBC configuration of the Windows 2000 server. This will give access to a internal SQL server database via TCP. A password username is required.
    When I try to add a SQLservice in the service designer using the SQL adapter I will use the following parameters:
    JDBC connect string: JDBC:ODBC:<DSNNAME>
    JDBC driver: sun.jdbc.odbc.JdbcOdbcDriver
    un: <username>
    pw: password>
    Query (without ';'): select count(*) from <tablename>
    Minimum number of Database connections in the pool 5
    Maximum number of Database connections in the pool 100
    Increment size for the connection pool 1
    Idle Timeout (in minutes) 30
    Now I get the following error:
    2/8/03 2:27:59 PM ERROR : [ApplicationServerThread] webtool.common.PtgErrorLog.outputError(PtgErrorLog.java:28)
    oracle.cabo.servlet.event.PageEventException: java.lang.ClassCastException: sun.jdbc.odbc.JdbcOdbcConnection,page=Page[name=designer/MasterServiceInitCreate],event=PageEvent[name=goto,source=wizardNav,fromPage=designer/MasterServiceInitCreate,JDBC_DRIVER=sun.jdbc.odbc.JdbcOdbcDriver,JDBC_CONNECT_STRING=jdbc:odbc:<DSNNAME>,CONNPOOL_INC=1,CONNPOOL_MIN=5,CONNPOOL_IDLETIMEOUT=30,USERNAME=<USERNAME>,value=4,SQLTYPE=QUERY,CONNPOOL_MAX=100,STATEMENT=select count(*) from bedrijven,PASSWORD=<PASSWORD>],rootCause=oracle.panama.adapter.AdapterException: java.lang.ClassCastException: sun.jdbc.odbc.JdbcOdbcConnection
    at oracle.cabo.servlet.event.BasePageFlowEngine.handleRequest(Unknown Source)
    at oracle.cabo.servlet.AbstractPageBroker.handleRequest(Unknown Source)
    at oracle.panama.webtool.common.PtgPageBroker.handleRequest(PtgPageBroker.java:152)
    at oracle.cabo.servlet.PageBrokerHandler.handleRequest(Unknown Source)
    at oracle.cabo.servlet.BajaServlet.doGet(Unknown Source)
    at oracle.cabo.servlet.BajaServlet.doPost(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:211)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:633)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:235)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:695)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:248)
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:62)
    I got the error 'java.lang.ClassCastException: sun.jdbc.odbc.JdbcOdbcConnection' in my log and tried to find out the meaning of this error at java.sun.com. It's stil not clear what exactly causes the error but it looks like a data formatting error.
    java.lang.ClassCastException
    (Thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance. For example, the following code generates a ClassCastException:
    Object x = new Integer(0);
    System.out.println((String)x); )
    Is it just a data formatting problem or has it something to do with the JDBC/ODBC driver version of the JDK from the appliction server release 2.0.
    I remember that I was always able to connect to the SQL server database with previous releases also with a count query. I've also used JDK 1.3.1 with o9iAS release 1.0.2.1.
    Any suggestions for a solution?
    Thanks in advance for your help.

    try this link:
    http://community.eapps.com/showthread.php?p=8

  • JDBC ODBC MSAccess crash

    Hello !
    I have a very serious problem with an application which uses a multithreading access to a ms-access 2000 DB.
    I am using the jdbc-odbc-driver from sun to read and write infomration into/ from the db in several threads. This works fine for about an hour or so and then without any kind of exception or other message the programm crahes! No stacktrace or something else ocurs. There isn't any kind of regularity in this behaviour like a certain number of accesses, a certain time period, etc.
    Funny is, that this works fine for more than 36 hours using a MySQL-DB which then uses a native JDBC-Driver and no ODBC-JDBC-Driber !
    Does anyone knows a solution or has some helpful other information for me ?
    Many thanks
    Andreas

    Is there any reason you have to use access? I noticed that when I was using access if I opened and closed a number of connection objects it would cause my application to crash. I went with another database that had it's own native jdbc-driver.

  • How to append records in MSAccess through Java using JDBC:ODBC

    Hello,
    I was able to retrieve records from MSAccess database through JAVA over the JDBC-ODBC bridge.
    If I want to append records to a table (for eg. photo1 table containing photono., length, breadth, area as
    columns) I could not able to do so through JAVA.
    I am using JTable with the above fields. The user is displayed with the JTable and he has to enter
    data inside the JTable and press a button titled "Append". Then the JAVA program should append
    whatever the user has entered in the JTable as a single record inside the MSAccess database.
    Can anyone help me please?

    hi i too am having similar problem. i am able to create a table in ms access through java but when i insert values i get a msg that it has inserted the values but when i check the table by opening ms-access there are no values in the table.
    the insert statement i am using is
    " insert into tk1 values(3,'tarun')"
    further i tried using the methods commit, setAutoCommit etc with the connection object. -NO GO.
    can you help me ?

  • SQLAllocHandle on SQL_HANDLE_ENV failed - JDBC-ODBC Error

    Hai,
    i am connecting the Oracle 8i by using the JDBC-ODBC Driver. When i get connection by using the DriverManager, it throws the following Error.
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed
    Please advise me
    Thanks in Advance
    Regards
    sankarjune14

    Respected Sir/Madam,
    i am connecting the Oracle 8i by using the JDBC-ODBC
    Driver. When i get connection by using the
    DriverManager, it throws the following Error.
    Driver's SQLAllocHandle on SQL_HANDLE_ENV failed.
    the dsn name already created succeesfully. then also i am
    getting this run time error
    plz give me a solution.

  • Stored Procedure error with JDBC:ODBC

    Hi,
    I am trying to run a stored procedure on RDMS (Uniaccess ODBC). This has 2 input parameters and returns a resultset of 3 columns. The following is the error I am getting and am stumped. Please help..
    (similar call statement works with VB and ADO)
    --------output ---------------
    Calling MGC005
    inside resultset sun.jdbc.odbc.JdbcOdbcCallableStatement@129206
    row 1
    get string 0004
    get string 00000
    get string
    SQLEcception : java.sql.SQLException: [AIS][UniAccess ODBC Driver]Invalid Column Number//Specified column is before the column specified in the previous call
    ----------------------source code ------------------
    import java.awt.Graphics;
    import java.sql.*;
    public class JdbcTest {
    public JdbcTest() {
         Connection con;
         CallableStatement stmt;
    try {
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver");
    catch (Exception ex) {
    System.out.println ("Database Driver not found");
    System.exit(0);
    try {
    String msDbUrl = "jdbc:odbc:CMS_TEST_ODBC";
    con = DriverManager.getConnection(msDbUrl, user, password );
    stmt = con.prepareCall("{ call MGC005(?, ?)}");
              stmt.setString( 1, "CH" );
              stmt.setString( 2, "ARRINGTON0909170320010615" );
    //          stmt.registerOutParameter( 1, java.sql.Types.VARCHAR);
    //          stmt.registerOutParameter( 2, java.sql.Types.VARCHAR );
    //           stmt.registerOutParameter( 3, java.sql.Types.VARCHAR );
              System.out.println( "Calling MGC005 " );
         ResultSet rs = stmt.executeQuery();
              while (rs.next()) {
    System.out.println( " inside resultset " + rs.getStatement() );
    System.out.println( " row " + rs.getRow() );
    System.out.println( " get string " + rs.getString(1) );
    System.out.println( " get string " + rs.getString(2) );
    System.out.println( " get string " + rs.getString(3) );
              String i = rs.getString (1);
              String s = rs.getString (2);
              String t = rs.getString (3);
    String text = i + " " + s ;
    System.out.println ( " Output " + text);
         stmt.close();
    con.close();
    } catch( SQLException ex ) {
    System.out.println ("SQLEcception : " + ex);
    public static void main(String[] args) {
    new JdbcTest();
    }

    Hi,
    The error seems to occur on the line:
    String i = rs.getString (1);
    The error exactly states what is occuring: "Specified column is before the column specified in the previous call". Try limiting the call to getString() to one for each column for each row.
    Try replacing these lines:
    System.out.println( " get string " + rs.getString(1) );
    System.out.println( " get string " + rs.getString(2) );
    System.out.println( " get string " + rs.getString(3) );
    String i = rs.getString (1);
    String s = rs.getString (2);
    String t = rs.getString (3);
    with something like:
    String i = rs.getString (1);
    System.out.println( " get string " + i);
    String s = rs.getString (2);
    System.out.println( " get string " + s);
    String t = rs.getString (3);
    System.out.println( " get string " + t);
    Hope this works,
    Kurt.

  • JDBC/ODBC Error

    Hello,
    I'm testing the following code that contects to an Access Database
    import java.sql.*;
    public class AccessTest
    public static void main(String[] args)
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String dataSourceName = "scan";
    String dbURL = "jdbc:odbc:" + dataSourceName;
    Connection con = DriverManager.getConnection(dbURL, "","");
    Statement s = con.createStatement
    ResultSet.TYPE_SCROLL_SENSITIVE,
    ResultSet.CONCUR_UPDATABLE);
    s.execute("select * from test");
    ResultSet rs = s.getResultSet();
    if (rs != null) // if rs == null, then there is no ResultSet to view
    while ( rs.next() ) // this will step through our data row-by-row
    /* the next line will get the first column in our current row's ResultSet
    as a String ( getString( columnNumber) ) and output it to the screen */
    // System.out.println(rs.getString("f_name")+"\t\t");
    rs.updateString("l_name","Welcomer ");
    rs.updateRow();
    // System.out.println("Last Name: "+rs.getString(2));
    System.out.println("Number: "+rs.getString(3));
    System.out.println("Age: "+rs.getString(4));
    //System.out.println("Date: "+rs.getDate(5));
    //Date tmp = rs.getDate(5);
    System.out.println();
    s.close(); // close the Statement to let the database know we're done with it
    con.close(); // close the Connection to let the database know we're done with it
    catch (Exception err) {
    System.out.println("ERROR: " + err);
    the code that is commented out, was done so as I tried to debug this. What I'm trying to do is update the field l_name in a record. Yes I know using SQL update will do it, but I need to it this way for my application that I'm designing. The error I get is
    java.sql.SQLException :[Microsoft][ODBC Microsoft Access Driver] Error in row.
    the table in question only has 3 entries. The last name is updated for the first only, thus the error is coming up before the result set is moved by one. Please advise.
    Thanks in advance

    Instead of multi-posting, why don't you just post a link to your other one(s), like this:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=337252
    Anyway, my guess is that maybe the MS Access driver doesn't allow updateable resultsets.

  • Jdbc-odbc error in an applet

    I'm trying to use a jdbc-odbc driver to connect to a db. When I do this using an application I have not problems but I'm trying to do the same in an applet and I get this error message:
    java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc
    Here is the part of the program where it happens
    try {
    Class.forName(driver);
    } catch(Exception ex) {
    setError("Can't find Database driver class: " + ex);
    return;
    I hope you can tell me

    copy this line in {jre}/lib/java.policy
    jre = java runtime directory
    permission java.lang.RuntimePermission "accessClassInPackage.sun.jdbc.odbc";

  • Compile error when connecting to JDBC:ODBC

    Hi
    I am not used to java so probably this is an enivorment problem, but I cannot fix, please help!
    FOLLOWING CODE
    import java.sql.*;
    public class DBtest {
    public static void main (String args[]) {
    String jdbcDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
    String protocolHeader = "jdbc:odbc:";
    String dbName = "myodbc3-test";
    String user = "";
    String password = "";
    Class.forName(jdbcDriver);
    Connection cn =
    DriverManager.getConnection(protocolHeader+dbName, user, password);
    GENERATES FOLLOWING COMPILING ERROR
    cd c:/Javakod/NewFolder/
    javac -classpath C:\Javakod\ DBtest.java
    DBtest.java:17: incompatible types
    found : java.sql.Connection
    required: NewFolder.Connection
    DriverManager.getConnection(protocolHeader+dbName, user, password);
    ^
    1 error
    What is wrong? I am using a Win2000.

    This code compiles and runs fine on my Windows 2000 machine running JDK 1.4.1:
    import java.sql.*;
    public class AnotherConnectionTester
        public static void main(String [] args)
            String jdbcDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
            String protocolHeader = "jdbc:odbc:";
            String dbName = "myodbc3-test";
            String user = "";
            String password = "";
            try
                Class.forName(jdbcDriver);
                Connection cn = DriverManager.getConnection(protocolHeader+dbName, user, password);
                DatabaseMetaData meta = cn.getMetaData();
                System.out.println("product name: " + meta.getDatabaseProductName());
            catch (Exception e)
                e.printStackTrace(System.err);
    }I set up an ODBC DSN myodbc3-test to connect to an Access database. It was no problem. I guess that doesn't explain why your post didn't work. I changed the name of the class and added that meta data output so I could make sure that it connected. - MOD

  • JDBC-ODBC BRIDGE (General error)

    I get some time "SQLException : general error" on the screen followed by a "[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]General network error. Check your network documentation" when i am using the jdbc-odbc bridge on a jsp page
    My configuration:
    OS : WIN NT 4.0
    TOMCAT 4.0
    JSP
    Database : SQL server 2000
    Database driver: Sun JDBC-ODBC bridge
    Could it come from a concurrent access problem?
    Does anyone have an idea?
    Thank you,
    Deenesh

    I've found that the descriptive "General Error" message ususally means there's something wrong with my sql. If your db passes Navin's test (meaning it's up and running), then try to take your sql query and paste it into a sql window for your db. Sometimes this gets you an error message that is a little more descriptive.

  • URGENT: Error:  Failed to Load JDBC/ODBC Driver

    I have created a database in Access and created user interface for it. Whenever I run the program from DOS (i.e java CarRental) the program begins but when I try to add a customer or add a vehicle I get the error java.lang.ClassNotFoundException: com.ms.jdbc.odbc.JdbcOdbcDriver.
    However, if I run it directly from MVisual J++ 6 it connects to the database fine. I have installed J2SDK 1_4 on my computer. Should I make changes to the following code?
    String url = "jdbc:odbc:CarRental";
                   try{
         Class.forName( "com.ms.jdbc.odbc.JdbcOdbcDriver" );
         connection = DriverManager.getConnection(url);
    Since I downloaded J2SDK does it need to be "sun.jdbc.odbc.JdbcOdbcDriver"?
    Please help- time is running thin!
    Thanks
    Angie

    The correct classname for the JDBC:ODBC bridge is
    sun.jdbc.odbc.JdbcOdbcDriver
    Thomas

  • Wierd behavior of jdbc:odbc using MSACCESS 2002

    I'm using msaccess 2002, java version 1.4.0, Windows XP.
    I configured ODBC driver for my database "MailDB" using "odbcad32".
    I have no problem retrieving data from my database to my program, however I can't insert data to my database.
    I've checked my SQL syntax, it works fine within Access.
    Does anyone have an idea what could be the problem?
    Code:
    import java.sql.*;
    public class AccessConnection
         public static void main(String[] args){
              try {
                   //Connecting to database
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   Connection conn = DriverManager.getConnection("jdbc:odbc:MailDB");
                   //Select Query - WORKS FINE!!!
                   ResultSet rS = conn.createStatement().executeQuery("Select * from MAIL" );
                   while (rS.next())
                        System.out.println(rS.getString("A"));               
                   rS.close();
                   //Insert Query - DOESNT WORK!!!!!!!!!!
                   conn.createStatement().executeUpdate("Insert Into MAIL (A,B,C) VALUES ('a','b','c') ;");
              catch (ClassNotFoundException e1){}
              catch (SQLException e){}

    1. Remove the semi-colon.
    2. Close the connection
    3. Do something with the exceptions - don't just discard them.

  • Jdbc-odbc bridge connection error

    Hi,
    Please help me to create a jdbc-odbc connection from Jdev10g to a TSM server database.
    I have created a database connection with the following parameters:
    Connection name: tsm1a
    Connection type: jdbc-odbc bridge
    Username: admin
    Password: ***
    Datasource name: tsm1 (this is the name of the DSN datasource name in my Windows ODBC DSN datasource)
    Extra parameters: NONE
    Clicking on the Test button shows Success!
    I have tried to launch the SQL worksheet, it is success and give me a correct result to my "select * from volumes" query.
    I have created a simple JSP page:
    <%@ page contentType="text/html;charset=windows-1250"%>
    <%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/sqltaglib.tld"
    prefix="database"%>
    <html>
    <body>
    <database:dbOpen connId="c1" URL="jdbc:odbc:TSM1a" user="admin" password="***">
    <database:dbQuery connId="c1" output="html" queryId="q1" >
    select * from volumes
    </database:dbQuery>
    </database:dbOpen>
    </body>
    </html>
    The result of the run of it:
    javax.servlet.jsp.JspTagException: Failed to establish connection     at oracle.jsp.dbutil.tagext.dbOpenTag.doStartTag(dbOpenTag.java:115)
    Please help me, how to get a connection to the ODBC datasource from a jsp page.
    What is wrong in the URL string or elsewhere ?
    Thanks a lot in advance:
    Arpad

    Hi,
    Please help me to create a jdbc-odbc connection from Jdev10g to a TSM server database.
    I have created a database connection with the following parameters:
    Connection name: tsm1a
    Connection type: jdbc-odbc bridge
    Username: admin
    Password: ***
    Datasource name: tsm1 (this is the name of the DSN datasource name in my Windows ODBC DSN datasource)
    Extra parameters: NONE
    Clicking on the Test button shows Success!
    I have tried to launch the SQL worksheet, it is success and give me a correct result to my "select * from volumes" query.
    I have created a simple JSP page:
    <%@ page contentType="text/html;charset=windows-1250"%>
    <%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/sqltaglib.tld"
    prefix="database"%>
    <html>
    <body>
    <database:dbOpen connId="c1" URL="jdbc:odbc:TSM1a" user="admin" password="***">
    <database:dbQuery connId="c1" output="html" queryId="q1" >
    select * from volumes
    </database:dbQuery>
    </database:dbOpen>
    </body>
    </html>
    The result of the run of it:
    javax.servlet.jsp.JspTagException: Failed to establish connection     at oracle.jsp.dbutil.tagext.dbOpenTag.doStartTag(dbOpenTag.java:115)
    Please help me, how to get a connection to the ODBC datasource from a jsp page.
    What is wrong in the URL string or elsewhere ?
    Thanks a lot in advance:
    Arpad

  • Ms Access problems with Jdbc Odbc!!!

    Hi again people,
    Im creating a GUI swing project connecting a database (MsAccess) to a dialog using the bridge driver,
    The GUI is coming up but im getting runtime errors and the data does not go to the fields, the dialog and connection are in two files:
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*; //SQL package for the statements
    import javax.swing.*;
    class DatabaseMan
         public ResultSet m_resultSet; //recordset resulting from SQL query
         public ResultSetMetaData m_rsmd; //used to get general info about the columns
         private int m_nNumberOfFields; //number of fields in a recordset
         private Connection conn;
         private Statement stmt;
         public DatabaseMan(String strSQLQuery)
              try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");          
                   try               //establish connection to the database
                        //try to get connection to the database
                        conn = DriverManager.getConnection("jdbc:odbc:db1");
                        //this is not where we update the database so we make it read only
                        stmt = conn.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE,
                                                                     ResultSet.CONCUR_READ_ONLY);                                   
                        m_resultSet = stmt.executeQuery(strSQLQuery);
                   catch(SQLException exSQL)
                        System.err.println("\n\n\t\t ***SQLException has" +
                                                 "been caught ***\n\n");
                   while ( exSQL != null)
                        System.err.println("\nSQLState : " + exSQL.getSQLState() );
                   System.err.println("\nMessage : " + exSQL.getMessage() );
                             System.err.println("\nVendor code : "+ exSQL.getErrorCode() );
                             System.err.println("\n");
                             exSQL = exSQL.getNextException();
              catch( ClassNotFoundException e)
                   System.err.print("\n\n\tClassNotFoundException has"
                                       +" been caught");
                   System.err.println( e.getMessage());
              catch( java.lang.Exception ex )
                   ex.printStackTrace();
         public void CloseConnection() //close connection to database
              try
                        conn.close();
                        stmt.close();
                        m_resultSet.close(); //release the resources
                   catch (SQLException exSQL )
                        System.out.println("SQL Exception: " + exSQL.getMessage());
                        exSQL.printStackTrace(System.out);
         public int getNoFields()
              return m_nNumberOfFields;
    } //end of DatabaseMan.java
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import DatabaseMan;
    import javax.swing.*;
    class DBviewer extends JDialog implements ActionListener
         //JButtons to create toolbar
         private JButton m_buttonFirst;
         private JButton m_buttonNext;
         private JButton m_buttonPrevious;
         private JButton m_buttonLast;
         private JButton m_buttonClose;
         private JButton m_mainbuttonClose;
         //textfields to transfer the data from database
         private JTextField m_name;
         private JTextField m_age;
         private JTextField m_weight;
         private JTextField m_professionalism;
         private JTextField m_speed;
         private JTextField m_acceleration;
         private JTextField m_jump;
         private JTextField m_stamina;
         private JTextField m_bravery;
         private JTextField m_fitness;
         private JTextField m_experience;
         //labels to identify the textfields
         private JLabel m_labelname;
         private JLabel m_labelage;
         private JLabel m_labelweight;
         private JLabel m_labelspeed;
         private JLabel m_labelacceleration;
         private JLabel m_labelprofessionalism;
         private JLabel m_labeljump;
         private JLabel m_labelstamina;
         private JLabel m_labelbravery;
         private JLabel m_labelfitness;
         private JLabel m_labelexperience;
         DatabaseMan m_DatabaseMan;
         private String strSQLQuery1;
         private String type1 = new String("");
         public DBviewer(Frame parent, String caption, boolean bModal, String type)
              super(parent,caption,true);
              setSize(600,400);
              setLocation( new Point(150 , 150 )); //position it pops up on screen.
              setResizable(false);
              strSQLQuery1 = new String("");
              type1 = type;
              //SQL query to show the horse database
              if(type =="Horse")
                   strSQLQuery1 ="SELECT *" +
                                  "FROM HORSE";
                   buildHorseGUI();
              if(type =="Jockey")
                   strSQLQuery1 ="SELECT *" +
                                  "FROM JOCKEY"+
                                  " ORDER BY NAME";
                   buildJockeyGUI();                         
              if(type =="Course")
                   strSQLQuery1 ="SELECT *" +
                   "FROM RACECOURSE"+
                                  " ORDER BY NAME";
                   buildCourseGUI();
              m_DatabaseMan = new DatabaseMan(strSQLQuery1);
              /*try
              {//reset values with default move up to top later
                   if(m_DatabaseMan.m_resultSet.first())
                        transferData(type1);
              catch( SQLException exSQL)
                   System.out.println("SQL Exception: " + exSQL.getMessage());
                   exSQL.printStackTrace(System.out);
         public void buildHorseGUI() //construct the horse GUI
              buildDefaultGUI(); //build default buttons and toolbar
              m_labelname = new JLabel(" Horse Name:",JLabel.CENTER);
              m_labelname.setBackground(Color.blue);
              m_labelname.setForeground(Color.white);
              m_labelage = new JLabel("Age: ",JLabel.CENTER);
              m_labelage.setBackground(Color.blue);
              m_labelage.setForeground(Color.white);     
              m_labelweight = new JLabel("Weight(p): ",JLabel.CENTER);
              m_labelweight.setBackground(Color.blue);
              m_labelweight.setForeground(Color.white);
              m_labelspeed = new JLabel("Speed:",JLabel.CENTER);
              m_labelspeed.setBackground(Color.blue);
              m_labelspeed.setForeground(Color.white);
              m_labelacceleration = new JLabel("Acceleration:",JLabel.CENTER);
              m_labelacceleration.setBackground(Color.blue);
              m_labelacceleration.setForeground(Color.white);
              m_labelprofessionalism = new JLabel("Professionalism:",JLabel.CENTER);
              m_labelprofessionalism.setBackground(Color.blue);
              m_labelprofessionalism.setForeground(Color.white);
              m_labeljump = new JLabel("Jump:",JLabel.CENTER);
              m_labeljump.setBackground(Color.blue);
              m_labeljump.setForeground(Color.white);
              m_labelstamina = new JLabel("Stamina:",JLabel.CENTER);
              m_labelstamina.setBackground(Color.blue);
              m_labelstamina.setForeground(Color.white);     
              m_labelbravery = new JLabel("Bravery:",JLabel.CENTER);
              m_labelbravery.setBackground(Color.blue);
              m_labelbravery.setForeground(Color.white);
              m_labelfitness = new JLabel("Fitness:",JLabel.CENTER);
              m_labelfitness.setBackground(Color.blue);
              m_labelfitness.setForeground(Color.white);     
              m_labelexperience = new JLabel("Experience",JLabel.CENTER);
              m_labelexperience.setBackground(Color.blue);
              m_labelexperience.setForeground(Color.white);          
              //creation of textfields to hold the data
              //making them non-editable and b/ground of black with white text
              m_name = new JTextField(20);
              m_name.setEditable(false);
              m_name.setBackground(Color.black);
              m_name.setForeground(Color.white);
              m_age = new JTextField(2);
              m_age.setEditable(false);
              m_age.setBackground(Color.black);
              m_age.setForeground(Color.white);
              m_weight = new JTextField(3);
              m_weight.setEditable(false);
              m_weight.setBackground(Color.black);
              m_weight.setForeground(Color.white);
              m_speed = new JTextField(2);
              m_speed.setEditable(false);
              m_speed.setBackground(Color.black);
              m_speed.setForeground(Color.white);
              m_acceleration = new JTextField(2);
              m_acceleration.setEditable(false);
              m_acceleration.setBackground(Color.black);
              m_acceleration.setForeground(Color.white);
              m_professionalism = new JTextField(2);
              m_professionalism.setEditable(false);
              m_professionalism.setBackground(Color.black);
              m_professionalism.setForeground(Color.white);
              m_jump = new JTextField(2);
              m_jump.setEditable(false);
              m_jump.setBackground(Color.black);
              m_jump.setForeground(Color.white);
              m_stamina = new JTextField(2);
              m_stamina.setEditable(false);
              m_stamina.setBackground(Color.black);
              m_stamina.setForeground(Color.white);
              m_bravery = new JTextField(2);
              m_bravery.setEditable(false);
              m_bravery.setBackground(Color.black);
              m_bravery.setForeground(Color.white);
              m_fitness = new JTextField(2);
              m_fitness.setEditable(false);
              m_fitness.setBackground(Color.black);
              m_fitness.setForeground(Color.white);
              m_experience = new JTextField(2);
              m_experience.setEditable(false);
              m_experience.setBackground(Color.black);
              m_experience.setForeground(Color.white);
              //create a panel to hold this data
              Panel data = new Panel();
              data.setLayout(new GridLayout(0,4));
              data.setBackground(Color.blue);
              data.add(m_labelname);
              data.add(m_name);
              data.add(m_labelage);
              data.add(m_age);
              data.add(m_labelweight);
              data.add(m_weight);
              data.add(m_labelspeed);
              data.add(m_speed);
              data.add(m_labelacceleration);
              data.add(m_acceleration);
              data.add(m_labelprofessionalism);
              data.add(m_professionalism);
              data.add(m_labeljump);
              data.add(m_jump);
              data.add(m_labelstamina);
              data.add(m_stamina);
              data.add(m_labelbravery);
              data.add(m_bravery);
              data.add(m_labelfitness);
              data.add(m_fitness);
              data.add(m_labelexperience);
              data.add(m_experience);
              getContentPane().add(data, BorderLayout.CENTER);
         public void buildDefaultGUI() //construct the default components for GUI
              JToolBar wndToolBar = new JToolBar();
              wndToolBar.setBackground(Color.green);
              wndToolBar.setFloatable(false);
              m_buttonFirst = new JButton( new ImageIcon( "graphic/myFirst.gif" ) );
              m_buttonPrevious = new JButton(new ImageIcon( "graphic/myPrevious.gif" ) );
              m_buttonNext = new JButton(new ImageIcon( "graphic/myNext.gif" ) );
              m_buttonLast = new JButton(new ImageIcon( "graphic/myLast.gif" ) );
              m_buttonClose = new JButton(new ImageIcon( "graphic/myClose.gif" ) );
              m_mainbuttonClose = new JButton("CLOSE");
              // implement action listener
              m_buttonFirst.addActionListener(this);
              m_buttonPrevious.addActionListener(this);
              m_buttonNext.addActionListener(this);
              m_buttonLast.addActionListener(this);
              m_buttonClose.addActionListener(this);
              m_mainbuttonClose.addActionListener(this);
              //set the tool tips for each of the button
              m_buttonFirst.setToolTipText( "Display first record" );
              m_buttonPrevious.setToolTipText( "Display previous record" );
              m_buttonNext.setToolTipText( "Display next record" );
              m_buttonLast.setToolTipText( "Display last record" );
              m_buttonClose.setToolTipText( "Close this window and return to game" );
              m_mainbuttonClose.setToolTipText( "Close this window and return to game" );
              m_mainbuttonClose.setBackground(Color.green);
              //add these buttons to the toolbar
              wndToolBar.add( m_buttonFirst );
              wndToolBar.add( m_buttonPrevious );
              wndToolBar.add( m_buttonNext );
              wndToolBar.add( m_buttonLast );
              wndToolBar.addSeparator(); //separator in the toolbar
              wndToolBar.add( m_buttonClose );
              getContentPane().add(wndToolBar, BorderLayout.NORTH);
              getContentPane().add(m_mainbuttonClose, BorderLayout.SOUTH);
         public void buildCourseGUI() //construct the course GUI
              buildDefaultGUI();
         public void buildJockeyGUI() //construct the jockey GUI
              buildDefaultGUI();
         public void actionPerformed( ActionEvent evt)
              //button first record is pressed
              if( evt.getSource() == m_buttonFirst )
                   try
                        if( m_DatabaseMan.m_resultSet.first() )
                             transferData(type1);
                   catch (SQLException exSQL )
                        System.err.println( exSQL.toString() );
              //button next record is pressed
              if( evt.getSource() == m_buttonNext )
                   try
                        if(!m_DatabaseMan.m_resultSet.isLast())
                             if(m_DatabaseMan.m_resultSet.next())
                                  transferData(type1);
                   catch (SQLException exSQL )
                        System.err.println( exSQL.toString() );
              //previous button is pressed
              if( evt.getSource() == m_buttonPrevious )
                   try
                        if( !m_DatabaseMan.m_resultSet.first())
                             if(m_DatabaseMan.m_resultSet.previous())
                                  transferData(type1);
                   catch (SQLException exSQL )
                        System.err.println( exSQL.toString() );
              //last button is pressed
              if( evt.getSource() == m_buttonLast )
                   try
                        if(m_DatabaseMan.m_resultSet.last())
                             transferData(type1);
                   catch (SQLException exSQL )
                        System.err.println( exSQL.toString() );
              // close button(s) pressed
              if( evt.getSource() == m_buttonClose)
                   setVisible( false );
                   dispose(); //return the dialog window resources
                   m_DatabaseMan.CloseConnection();
              if( evt.getSource() == m_mainbuttonClose)
                   setVisible( false );
                   dispose(); //return the dialog window resources
                   m_DatabaseMan.CloseConnection();
         public void transferData(String type1) throws SQLException //return a String
              if(type1 =="Horse")
                   //transfer horse details
                   m_name.setText(m_DatabaseMan.m_resultSet.getString("NAME"));
                   m_professionalism.setText(m_DatabaseMan.m_resultSet.getString("PROFESSIONALISM"));
                   m_speed.setText(m_DatabaseMan.m_resultSet.getString("SPEED"));
                   m_stamina.setText(m_DatabaseMan.m_resultSet.getString("STAMINA"));
                   m_weight.setText(m_DatabaseMan.m_resultSet.getString("WEIGHT"));
                   m_experience.setText(m_DatabaseMan.m_resultSet.getString("EXPERIENCE"));
                   m_fitness.setText(m_DatabaseMan.m_resultSet.getString("FITNESS"));
                   m_jump.setText(m_DatabaseMan.m_resultSet.getString("JUMP"));
                   m_age.setText(m_DatabaseMan.m_resultSet.getString("AGE"));
                   m_bravery.setText(m_DatabaseMan.m_resultSet.getString("BRAVERY"));
                   m_acceleration.setText(m_DatabaseMan.m_resultSet.getString("ACCELERATION"));
              if(type1 =="Jockey")
                   m_name.setText(m_DatabaseMan.m_resultSet.getString("NAME"));
                   m_age.setText(m_DatabaseMan.m_resultSet.getString("AGE"));
              if(type1 =="Course")
                   //transfer course details not implemented yet
    } //end of class DBviewer
    I ve set up an odbc driver and the database has data in it but I still get this run time error an no data is transfered to the dialog box
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1525)
    at sun.jdbc.odbc.JdbcOdbcResultSet.reWordAsCountQuery(JdbcOdbcResultSet.java:6268)
    at sun.jdbc.odbc.JdbcOdbcResultSet.calculateRowCount(JdbcOdbcResultSet.java:6061)
    at sun.jdbc.odbc.JdbcOdbcResultSet.initialize(JdbcOdbcResultSet.java:150)
    at sun.jdbc.odbc.JdbcOdbcStatement.getResultSet(JdbcOdbcStatement.java:420)
    at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(JdbcOdbcStatement.java:250)
    at DatabaseMan.<init>(DatabaseMan.java:34)
    at DBviewer.<init>(DBviewer.java:83)
    at MainWindow.actionPerformed(MainWindow.java:266)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:216)
    at java.awt.Component.processMouseEvent(Component.java:3715)
    at java.awt.Component.processEvent(Component.java:3544)
    at java.awt.Container.processEvent(Container.java:1164)
    at java.awt.Component.dispatchEventImpl(Component.java:2593)
    at java.awt.Container.dispatchEventImpl(Container.java:1213)
    at java.awt.Component.dispatchEvent(Component.java:2497)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
    at java.awt.Container.dispatchEventImpl(Container.java:1200)
    at java.awt.Window.dispatchEventImpl(Window.java:914)
    at java.awt.Component.dispatchEvent(Component.java:2497)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
    Im really stuck!!! any suggestions? thanks in advance

    Thank you for your response and sorry for the length
    of code,
    Thats was my first idea that it was asking for
    or something I dont have but I checked my database and
    I dont have any unusually large data entries (most
    between 8-15 letters, the others are numbers) could it
    be something wrong with how I've entered the database
    in MsAccess, or am i barking up the wrong tree again!
    Many thanks
    RobI think you've misunderstood me. This has nothing to do with unusually large data entries, but rather the opposite. You are wrongly expecting data that is shorter than you think. When you call rs.getString(i) to retrieve a column value of a field, and you only want the first 5 characters in the column (instead of 10 or whatever the column size is), you would do something similar to the following:
    String column_value = rs.getString(1).subtstring(0,5);The above expects a String that is at least 5 characters. Your problem is when your column value returned is less than the specified substring index ( in this case 5 ) it will throw an exception. If you changed your code to this, the error will not occur:
    String column_value = rs.getString( 1 ).subtstring( 0, 5);
    if ( column_value.length() > 5 )
    column_value = column_value.substring( 0, 5 );
    }Jamie

  • Jdbc-odbc connectivity problem in[b] wsad5.1.2[/b]

    while i Try to access the msaccess database using sun.jdbc.odbc.JdbcOdbcDriver,the server is giving the error class not found....sun.jdbc.odbc.JdbcOdbcDriver......
    I have already rt.jar containing this class in my jre...
    The same thing i tried in wsad5.0 and it is working abs fine....
    If anyone has got a time to solve tis query plz help me out...
    Its urgent......

    well,i think nobody has interest in my question.I have asked two questions.
    1)Can anybody tell me the compatibilities of JDBC-ODBC bridge versions,oracle and ODBC drivers?
    2)And can u tell me how to connect to oracle through a pure Java JDBC drivers (type 4 drivers) on a standalone system?
    But u advise me not to use JDBC-ODBC bridge without studying the other part.

Maybe you are looking for

  • Firefox cannot install PitchDark 3.6.2 because of invalid hash.

    From both the Mozilla addon site and thebankshow.com site, I try to install Pitchdark from the following link: https://addons.mozilla.org/en-US/firefox/addon/1529 However, each time, I get the following dialog box message: Firefox could not install t

  • Rotate external display

    How can i rotate my external display?  When i use the command-option key i get the option to rotate my i mac display but not my external display.

  • How to use left outer joins ,right outer joins and order by clause for belo

    Hi, How to use left outer joins ,right outer joins and order by clause for below XML query. The query which is red colour returns null then its not displaying any values for columns in that tables. Tried decode, nvl function hasn't worked. SELECT XML

  • Satviewe help PKGBUILD

    Here is my PKGBUILD http://pastebin.com/Cx2iugy7 17 line is empty i dont know what to put here is install.sh http://pastebin.com/b6nSrjH7 and what i need to put to file was in /usr/bin ?

  • Final invoice indicator for Service based IV

    Hello, For invoice verification based on Service entry, the system proposes the final invoice indicator checked.  I'm trying to uncheck this indicator as in our case, vendors usually sends partial invoices. We have FM implemented and applied Link: [n