Java.sql.SQLException[Microsoft][ODBC Driver for Oracle][Oracle]

I have just installed Oracle8i and i m trying to connect a project to d database using ODBC. I gave
Driver class name as sun.jdbc.odbc.JdbcOdbcDriver
Connection Info as jdbc:odbc:dbgen dbgen is my project name
Database name as Oracle
Username as scott
Password as Tiger
i am getting this exception
java.sql.SQLException[Microsoft][ODBC Driver for Oracle][Oracle]
can ne one help me out plz???

hi
dbgen is your project name? it should be the dsn name that has to be mentioned. Go to control panel->administrative tools>data sources and add the type of driver required.
import java.sql.*;
import oracle.jdbc.pool.*;
public class TestThinDSApp {
  public static void main(String args[]) throws ClassNotFoundException,
      SQLException {
    // These settings are typically configured in JNDI
    // so they a implementation specific
    OracleDataSource ds = new OracleDataSource();
    ds.setDriverType("thin");
    ds.setServerName("dssw2k01");
    ds.setPortNumber(1521);
    ds.setDatabaseName("orcl"); // sid
    ds.setUser("scott");
    ds.setPassword("tiger");
    Connection conn = ds.getConnection();
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt
        .executeQuery("select 'Hello Thin driver data source tester '||"
            + "initcap(USER)||'!' result from dual");
    if (rset.next())
      System.out.println(rset.getString(1));
    rset.close();
    stmt.close();
    conn.close();
}Hope this helps to some extent..
Edited by: S.Manikandan on Jun 21, 2008 10:07 AM

Similar Messages

  • App failed due to java.sql.SQLException: [Microsoft][ODBC driver for Oracl

    Hello I developed a small applicaion for insert data into database.but i am getting exception in the server like this.
    app failed due to java.sql.SQLException: [Microsoft][ODBC driver for Oracle][Oracle]ORA-01401: inserted value too large for column
    And the code is given below..
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Jdbc1 extends HttpServlet
    public void service(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
    PrintWriter out=response.getWriter();
    String no=request.getParameter("no");
    String name=request.getParameter("name");
    String age=request.getParameter("age");
    try
    System.out.println("1");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("2");
    Connection con=DriverManager.getConnection("jdbc:odbc:rakesh","scott","tiger");
    System.out.println("3");
    Statement st=con.createStatement();
    System.out.println("4");
    st.executeUpdate("INSERT INTO ind VALUES('+no+','+name+','+age+')" );
    con.commit();
    con.close();
    catch(Exception e)
    System.out.println(" app failed due to "+e);
    }Please give solution for this....

    Hello sir..
    thanks for ur reply...
    for oracle 10g -----> we use XE as datasourse
    name..What?
    now i am using oracle 8i...Not so from the code you posted. Didn't I see "jdbc:odbc:..." in your first post?
    so what should i
    write...in the datasourse name...that means.......
    Connection
    con=DriverManager.getConnection("jdbc:oracle:thin:@loc
    alhost:1521:????????","scott","tiger");Do you really use the default username and password?
    What should i write in place of ?????????..The name of the database you wish to connect to, of course.
    Do you have your tnsnames.ora set up properly? Did you install this database?
    None of this has ANYTHING to do with the error you posted, of course. Fix that first and then worry about the thin driver. At least it appears that the code you posted managed to connect to the database.
    %

  • SQLException:java.sql.SQLException:[Microsoft][Odbc driver for Oracle]

    hi all..im tryin to connect to Oracle db from java application.. i can complile the code but when it comes to executing d cod im gettin d followin error.. pls help me out.. here is d error
    SQLException:java.sql.SQLException:[Microsoft][Odbc driver for Oracle][Oracle]

    henrymania wrote:
    This is d driver im loadin..
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    and this is URL im assiging....
    "jdbc:oracle:thin:@192.168.32.68:1521:test";
    Here test is my sid name....highly unlikely, as that's not an ODBC driver nor is it an ODBC DSN.

  • Java.sql.SQLException:[Microsoft][ODBC Driver]Too few parameters Expected 1

    Hi friends,
    Greetings.
    i am trying to work with my inventory management system. My code is as follows and i getan error as follows:
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few
    parameters. Expected 1.
    CODING:
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class iteminsert extends HttpServlet
    public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
    Connection con;
    Statement r,s;
    ResultSet rs;
    int flag1=0;//flag1 is for seeing if itemcode already exists
    String str1,str2;
    String s0=req.getParameter("itemcode");
    String s1=req.getParameter("itemname");
    int s2=Integer.parseInt(req.getParameter("unit"));
    int s3=Integer.parseInt(req.getParameter("minlevel"));
    int s4=Integer.parseInt(req.getParameter("rate"));
    int a=1;
    int b=0;
    res.setContentType("text/HTML");
    PrintWriter out=res.getWriter();
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con=DriverManager.getConnection("jdbc:odbc:stocks");
    r=con.createStatement();
    s=con.createStatement();
    rs=r.executeQuery("select * from stock where itemcode='"+s0+"'");
    while(rs.next())
    flag1++;
    if(flag1!=0)
    out.println("<body><h1 align=\"center\"><font color=\"green\">INVENTORY MANAGEMENT SYSTEM</font></h1><p>ITEM CODE ALREADY EXISTS!!!!</p><p>To insert an item with a different code, <a href=\"http://localhost:8000/stock/insert.html\">Click here</a> .</p><p>To go back to the main menu <a href=\"http://localhost:8000/stock/index.html\">click here</a></p></body>");
    else
    str1="insert into stock values('"+s0+"','"+s1+"',"+s2+","+s3+","+s4+","+a+")";
    str2="insert into stock values('"+s0+"','"+s1+"',"+s2+","+s3+","+s4+","+b+")";
    if(s3<=s4)
    s.executeUpdate(str2);
    out.println("<body><h1 align=\"center\"><font color=\"green\">INVENTORY MANAGEMENT SYSTEM</font></h1><p>ITEM HAS BEEN INSERTED. HOWEVER REORDER LEVEL IS <b><u>MORE THAN</u></b> QUANTITY AT HAND</p><p>To buy more <a href=\"http://localhost:8000/stock/purchase.html\">Click here</a></p><p>To go back to the main menu <a href=\"http://localhost:8000/stock/index.html\">click here</a></p>");
    else
    s.executeUpdate(str1);
    out.println("<body><h1 align=\"center\"><font color=\"green\">INVENTORY MANAGEMENT SYSTEM</font></h1><p>ITEM HAS BEEN INSERTED.</p><p>To buy more <a href=\"http://localhost:8000/stock/purchase.html\">Click here</a></p><p>To go back to the main menu <a href=\"http://localhost:8000/stock/index.html\">click here</a></p></body>");
    con.close();
    catch(Exception e)
    out.println("error"+ e);
    Please help. I have to use only Create statement and not PreparedStatement :(
    Thank You.
    Regards.
    Aravind

    your code is wrong on so many levels.
    you should not be embedding HTML in Java objects this way. wrong, wrong, wrong.
    JSPs are what you should be using.
    look at this line:
    rs=r.executeQuery("select * from stock where itemcode='"s0"'");the SQL query is supposed to be a bloody string. yours won't even compile.
    do it this way:
    PreparedStatement ps = connection.prepareStatement("select * from stock where itemcode = ?");
    ps.setString(1, itemCode);
    rs = ps.executeQuery();you don't close resources. you don't use code tags.
    too much wrong to fix here.
    %

  • Java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name no

    Hi,
    I am working with the following program. The same program is working with JBOSS but not with Tomcat-5. I am using MS-Access. Working with this program is very essential now. Please Help me.
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    public class MDBGetData extends HttpServlet{
         Connection con=null;
         Statement st=null;
         ResultSet rs=null;
         public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException{
              PrintWriter out=res.getWriter();
              out.println("Connecting To data Base");
              try{
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   con=DriverManager.getConnection("jdbc:odbc:cmpny","sa","");
                   st=con.createStatement();
                   out.println("Connected to database");
                   rs=st.executeQuery("select * from cmpny");
                   while(rs.next()){
                        out.println(rs.getString(1));
              catch(Exception e){
                   System.out.println("Error While Creating The connection : " +e);
    }

    This is code for connect mySQL database:
    Connection con=null;
         Statement stmt=null;
         ResultSet rs=null;
         // Set up the JDBC connection
         try {     
              // Create
              InitialContext ctx=new InitialContext();
              ds=(DataSource)ctx.lookup("java:comp/env/jdbc/mysql");
              con=ds.getConnection();
              stmt=con.createStatement();
              rs=stmt.executeQuery(sqlQuery);
    catch(SQLException e){
    Note: before you use these code you have to set datasource in tomcat
    I will show you how to do it next post.

  • Java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Unspecified error

    Hi All,
    I am getting the following error when i am running swing program. I have a large volume of data. My resultset is running upto 2 hours. after 2 hours process is stoped and i got the following error on console.I am using Swing and MS SQL Server 2000.
    Exception :java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Unspecified error occurred on SQL Server. Connection may have been terminated by the server.
    Exception :java.sql.SQLException: General error
    GenerateAuditBatches.java sql 4 : select count(*) from tblTransaction where AuditID = 10001720 and     ExcludedFromAudit = 'F' and     SystemPricedFare = 'F'
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.lang.Exception: Invalid handle [null] Database error code:0
    GenerateAuditBatches.java sql 5 transactions : select tblTransaction.BatchID,          tblTransaction.TransactionNumber,          tblTransaction.PrimeDocumentNumber,          tblTransaction.AgentIATACode,          tblTransaction.NetRemitInd,          tblTransaction.ITBTFare,          tblTransaction.TourCode,          tblTransaction.FareBasis,          tblTransaction.TransactionCode,          tblTransaction.TransactionCategory,          tblTransaction.InternationalOrDomestic,          tblTransaction.NumberOfSectors,          tblTransaction.TransactionStatus,          tblTransaction.TransactionStatusUserID,          tblTransactionCRSCheck.FareCorrect,          tblTransactionCRSCheck.TaxCorrect,          tblTransactionCRSCheck.CommissionCorrect,          tblTransactionCRSCheck.ContractRulesCorrect,          tblTransactionCRSCheck.ContractID from tblTransaction left join tblTransactionCRSCheck on     tblTransactionCRSCheck.AuditID = tblTransaction.AuditID and     tblTransactionCRSCheck.TransactionNumber = tblTransaction.TransactionNumber where tblTransaction.AuditID = 10001720 and     tblTransaction.ExcludedFromAudit = 'F' and     tblTransaction.SystemPricedFare = 'F' order by tblTransaction.FareBasis
    Exception :java.sql.SQLException: Invalid handle
    java.lang.Exception: Invalid handle [null] Database error code:0
         at com.select.auditlink.GenerateAuditBatches.batchTransactions(GenerateAuditBatches.java:966)
         at com.select.auditlink.GenerateAuditBatches.batchAudit(GenerateAuditBatches.java:464)
         at com.select.auditlink.GenerateAuditBatches.run(GenerateAuditBatches.java:169)
    Exception :java.sql.SQLException: General error
    java.lang.Exception: Invalid handle [null] Database error code:0
         at com.select.auditlink.GenerateAuditBatches.batchTransactions(GenerateAuditBatches.java:966)
         at com.select.auditlink.GenerateAuditBatches.batchAudit(GenerateAuditBatches.java:469)
         at com.select.auditlink.GenerateAuditBatches.run(GenerateAuditBatches.java:169)
    GenerateAuditBatches.java sql 4 : select count(*) from tblTransaction where AuditID = 10001720 and     ExcludedFromAudit = 'F' and     SystemPricedFare = 'F'
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.lang.Exception: Invalid handle [null] Database error code:0
    GenerateAuditBatches.java sql 5 transactions : select tblTransaction.BatchID,          tblTransaction.TransactionNumber,          tblTransaction.PrimeDocumentNumber,          tblTransaction.AgentIATACode,          tblTransaction.NetRemitInd,          tblTransaction.ITBTFare,          tblTransaction.TourCode,          tblTransaction.FareBasis,          tblTransaction.TransactionCode,          tblTransaction.TransactionCategory,          tblTransaction.InternationalOrDomestic,          tblTransaction.NumberOfSectors,          tblTransaction.TransactionStatus,          tblTransaction.TransactionStatusUserID,          tblTransactionCRSCheck.FareCorrect,          tblTransactionCRSCheck.TaxCorrect,          tblTransactionCRSCheck.CommissionCorrect,          tblTransactionCRSCheck.ContractRulesCorrect,          tblTransactionCRSCheck.ContractID from tblTransaction left join tblTransactionCRSCheck on     tblTransactionCRSCheck.AuditID = tblTransaction.AuditID and     tblTransactionCRSCheck.TransactionNumber = tblTransaction.TransactionNumber where tblTransaction.AuditID = 10001720 and     tblTransaction.ExcludedFromAudit = 'F' and     tblTransaction.SystemPricedFare = 'F' order by tblTransaction.FareBasis
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.sql.SQLException: Connection is closed
    GenerateAuditBatches.java sql 4 : select count(*) from tblTransaction where AuditID = 10001720 and     ExcludedFromAudit = 'F' and     SystemPricedFare = 'F'
    java.lang.Exception: Invalid handle [null] Database error code:0
         at com.select.auditlink.GenerateAuditBatches.batchTransactions(GenerateAuditBatches.java:966)
         at com.select.auditlink.GenerateAuditBatches.batchAudit(GenerateAuditBatches.java:474)
         at com.select.auditlink.GenerateAuditBatches.run(GenerateAuditBatches.java:169)
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.lang.Exception: Invalid handle [null] Database error code:0
    GenerateAuditBatches.java sql 5 transactions : select tblTransaction.BatchID,          tblTransaction.TransactionNumber,          tblTransaction.PrimeDocumentNumber,          tblTransaction.AgentIATACode,          tblTransaction.NetRemitInd,          tblTransaction.ITBTFare,          tblTransaction.TourCode,          tblTransaction.FareBasis,          tblTransaction.TransactionCode,          tblTransaction.TransactionCategory,          tblTransaction.InternationalOrDomestic,          tblTransaction.NumberOfSectors,          tblTransaction.TransactionStatus,          tblTransaction.TransactionStatusUserID,          tblTransactionCRSCheck.FareCorrect,          tblTransactionCRSCheck.TaxCorrect,          tblTransactionCRSCheck.CommissionCorrect,          tblTransactionCRSCheck.ContractRulesCorrect,          tblTransactionCRSCheck.ContractID from tblTransaction left join tblTransactionCRSCheck on     tblTransactionCRSCheck.AuditID = tblTransaction.AuditID and     tblTransactionCRSCheck.TransactionNumber = tblTransaction.TransactionNumber where tblTransaction.AuditID = 10001720 and     tblTransaction.ExcludedFromAudit = 'F' and     tblTransaction.SystemPricedFare = 'F' order by tblTransaction.FareBasis
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.sql.SQLException: Connection is closed
    GenerateAuditBatches.java sql 4 : select count(*) from tblTransaction where AuditID = 10001720 and     ExcludedFromAudit = 'F' and     SystemPricedFare = 'T'
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.lang.Exception: Invalid handle [null] Database error code:0
    GenerateAuditBatches.java sql 5 transactions : select tblTransaction.BatchID,          tblTransaction.TransactionNumber,          tblTransaction.PrimeDocumentNumber,          tblTransaction.AgentIATACode,          tblTransaction.NetRemitInd,          tblTransaction.ITBTFare,          tblTransaction.TourCode,          tblTransaction.FareBasis,          tblTransaction.TransactionCode,          tblTransaction.TransactionCategory,          tblTransaction.InternationalOrDomestic,          tblTransaction.NumberOfSectors,          tblTransaction.TransactionStatus,          tblTransaction.TransactionStatusUserID,          tblTransactionCRSCheck.FareCorrect,          tblTransactionCRSCheck.TaxCorrect,          tblTransactionCRSCheck.CommissionCorrect,          tblTransactionCRSCheck.ContractRulesCorrect,          tblTransactionCRSCheck.ContractID from tblTransaction left join tblTransactionCRSCheck on     tblTransactionCRSCheck.AuditID = tblTransaction.AuditID and     tblTransactionCRSCheck.TransactionNumber = tblTransaction.TransactionNumber where tblTransaction.AuditID = 10001720 and     tblTransaction.ExcludedFromAudit = 'F' and     tblTransaction.SystemPricedFare = 'T' order by tblTransaction.FareBasis
    java.lang.Exception: Invalid handle [null] Database error code:0
         at com.select.auditlink.GenerateAuditBatches.batchTransactions(GenerateAuditBatches.java:966)
         at com.select.auditlink.GenerateAuditBatches.batchAudit(GenerateAuditBatches.java:419)
         at com.select.auditlink.GenerateAuditBatches.run(GenerateAuditBatches.java:172)
    java.lang.Exception: Invalid handle [null] Database error code:0
         at com.select.auditlink.GenerateAuditBatches.batchTransactions(GenerateAuditBatches.java:966)
         at com.select.auditlink.GenerateAuditBatches.batchAudit(GenerateAuditBatches.java:424)
         at com.select.auditlink.GenerateAuditBatches.run(GenerateAuditBatches.java:172)
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.sql.SQLException: Connection is closed
    GenerateAuditBatches.java sql 4 : select count(*) from tblTransaction where AuditID = 10001720 and     ExcludedFromAudit = 'F' and     SystemPricedFare = 'T'
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.lang.Exception: Invalid handle [null] Database error code:0
    GenerateAuditBatches.java sql 5 transactions : select tblTransaction.BatchID,          tblTransaction.TransactionNumber,          tblTransaction.PrimeDocumentNumber,          tblTransaction.AgentIATACode,          tblTransaction.NetRemitInd,          tblTransaction.ITBTFare,          tblTransaction.TourCode,          tblTransaction.FareBasis,          tblTransaction.TransactionCode,          tblTransaction.TransactionCategory,          tblTransaction.InternationalOrDomestic,          tblTransaction.NumberOfSectors,          tblTransaction.TransactionStatus,          tblTransaction.TransactionStatusUserID,          tblTransactionCRSCheck.FareCorrect,          tblTransactionCRSCheck.TaxCorrect,          tblTransactionCRSCheck.CommissionCorrect,          tblTransactionCRSCheck.ContractRulesCorrect,          tblTransactionCRSCheck.ContractID from tblTransaction left join tblTransactionCRSCheck on     tblTransactionCRSCheck.AuditID = tblTransaction.AuditID and     tblTransactionCRSCheck.TransactionNumber = tblTransaction.TransactionNumber where tblTransaction.AuditID = 10001720 and     tblTransaction.ExcludedFromAudit = 'F' and     tblTransaction.SystemPricedFare = 'T' order by tblTransaction.FareBasis
    Exception :java.sql.SQLException: Invalid handle
    java.lang.Exception: Invalid handle [null] Database error code:0
    Exception :java.sql.SQLException: Connection is closed
    GenerateAuditBatches.java sql 4 : select count(*) from tblTransaction where AuditID = 10001720 and     ExcludedFromAudit = 'F' and     SystemPricedFare = 'T'
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.lang.Exception: Invalid handle [null] Database error code:0
         at com.select.auditlink.GenerateAuditBatches.batchTransactions(GenerateAuditBatches.java:966)
         at com.select.auditlink.GenerateAuditBatches.batchAudit(GenerateAuditBatches.java:429)
         at com.select.auditlink.GenerateAuditBatches.run(GenerateAuditBatches.java:172)
    java.lang.Exception: Invalid handle [null] Database error code:0
         at com.select.auditlink.GenerateAuditBatches.batchTransactions(GenerateAuditBatches.java:966)
         at com.select.auditlink.GenerateAuditBatches.batchAudit(GenerateAuditBatches.java:434)
         at com.select.auditlink.GenerateAuditBatches.run(GenerateAuditBatches.java:172)
    GenerateAuditBatches.java sql 5 transactions : select tblTransaction.BatchID,          tblTransaction.TransactionNumber,          tblTransaction.PrimeDocumentNumber,          tblTransaction.AgentIATACode,          tblTransaction.NetRemitInd,          tblTransaction.ITBTFare,          tblTransaction.TourCode,          tblTransaction.FareBasis,          tblTransaction.TransactionCode,          tblTransaction.TransactionCategory,          tblTransaction.InternationalOrDomestic,          tblTransaction.NumberOfSectors,          tblTransaction.TransactionStatus,          tblTransaction.TransactionStatusUserID,          tblTransactionCRSCheck.FareCorrect,          tblTransactionCRSCheck.TaxCorrect,          tblTransactionCRSCheck.CommissionCorrect,          tblTransactionCRSCheck.ContractRulesCorrect,          tblTransactionCRSCheck.ContractID from tblTransaction left join tblTransactionCRSCheck on     tblTransactionCRSCheck.AuditID = tblTransaction.AuditID and     tblTransactionCRSCheck.TransactionNumber = tblTransaction.TransactionNumber where tblTransaction.AuditID = 10001720 and     tblTransaction.ExcludedFromAudit = 'F' and     tblTransaction.SystemPricedFare = 'T' order by tblTransaction.FareBasis
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.sql.SQLException: Connection is closed
    GenerateAuditBatches.java sql 4 : select count(*) from tblTransaction where AuditID = 10001720 and     ExcludedFromAudit = 'F' and     SystemPricedFare = 'F'
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.lang.Exception: Invalid handle [null] Database error code:0
    GenerateAuditBatches.java sql 5 transactions : select tblTransaction.BatchID,          tblTransaction.TransactionNumber,          tblTransaction.PrimeDocumentNumber,          tblTransaction.AgentIATACode,          tblTransaction.NetRemitInd,          tblTransaction.ITBTFare,          tblTransaction.TourCode,          tblTransaction.FareBasis,          tblTransaction.TransactionCode,          tblTransaction.TransactionCategory,          tblTransaction.InternationalOrDomestic,          tblTransaction.NumberOfSectors,          tblTransaction.TransactionStatus,          tblTransaction.TransactionStatusUserID,          tblTransactionCRSCheck.FareCorrect,          tblTransactionCRSCheck.TaxCorrect,          tblTransactionCRSCheck.CommissionCorrect,          tblTransactionCRSCheck.ContractRulesCorrect,          tblTransactionCRSCheck.ContractID from tblTransaction left join tblTransactionCRSCheck on     tblTransactionCRSCheck.AuditID = tblTransaction.AuditID and     tblTransactionCRSCheck.TransactionNumber = tblTransaction.TransactionNumber where tblTransaction.AuditID = 10001720 and     tblTransaction.ExcludedFromAudit = 'F' and     tblTransaction.SystemPricedFare = 'F' order by tblTransaction.FareBasis
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.sql.SQLException: Connection is closedjava.lang.Exception: Invalid handle [null] Database error code:0
         at com.select.auditlink.GenerateAuditBatches.batchTransactions(GenerateAuditBatches.java:966)
         at com.select.auditlink.GenerateAuditBatches.batchAudit(GenerateAuditBatches.java:439)
         at com.select.auditlink.GenerateAuditBatches.run(GenerateAuditBatches.java:172)
    GenerateAuditBatches.java sql 4 : select count(*) from tblTransaction where AuditID = 10001720 and     ExcludedFromAudit = 'F' and     SystemPricedFare = 'F'
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.lang.Exception: Invalid handle [null] Database error code:0
    GenerateAuditBatches.java sql 5 transactions : select tblTransaction.BatchID,          tblTransaction.TransactionNumber,          tblTransaction.PrimeDocumentNumber,          tblTransaction.AgentIATACode,          tblTransaction.NetRemitInd,          tblTransaction.ITBTFare,          tblTransaction.TourCode,          tblTransaction.FareBasis,          tblTransaction.TransactionCode,          tblTransaction.TransactionCategory,          tblTransaction.InternationalOrDomestic,          tblTransaction.NumberOfSectors,          tblTransaction.TransactionStatus,          tblTransaction.TransactionStatusUserID,          tblTransactionCRSCheck.FareCorrect,          tblTransactionCRSCheck.TaxCorrect,          tblTransactionCRSCheck.CommissionCorrect,          tblTransactionCRSCheck.ContractRulesCorrect,          tblTransactionCRSCheck.ContractID from tblTransaction left join tblTransactionCRSCheck on     tblTransactionCRSCheck.AuditID = tblTransaction.AuditID and     tblTransactionCRSCheck.TransactionNumber = tblTransaction.TransactionNumber where tblTransaction.AuditID = 10001720 and     tblTransaction.ExcludedFromAudit = 'F' and     tblTransaction.SystemPricedFare = 'F' order by tblTransaction.FareBasis
    Exception :java.sql.SQLException: Invalid handle
    java.lang.Exception: Invalid handle [null] Database error code:0
         at com.select.auditlink.GenerateAuditBatches.batchTransactions(GenerateAuditBatches.java:966)
         at com.select.auditlink.GenerateAuditBatches.batchAudit(GenerateAuditBatches.java:444)
         at com.select.auditlink.GenerateAuditBatches.run(GenerateAuditBatches.java:172)
    Exception :java.sql.SQLException: Connection is closed
    GenerateAuditBatches.java sql 4 : select count(*) from tblTransaction where AuditID = 10001720 and     ExcludedFromAudit = 'F' and     SystemPricedFare = 'F'
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.lang.Exception: Invalid handle [null] Database error code:0
    GenerateAuditBatches.java sql 5 transactions : select tblTransaction.BatchID,          tblTransaction.TransactionNumber,          tblTransaction.PrimeDocumentNumber,          tblTransaction.AgentIATACode,          tblTransaction.NetRemitInd,          tblTransaction.ITBTFare,          tblTransaction.TourCode,          tblTransaction.FareBasis,          tblTransaction.TransactionCode,          tblTransaction.TransactionCategory,          tblTransaction.InternationalOrDomestic,          tblTransaction.NumberOfSectors,          tblTransaction.TransactionStatus,          tblTransaction.TransactionStatusUserID,          tblTransactionCRSCheck.FareCorrect,          tblTransactionCRSCheck.TaxCorrect,          tblTransactionCRSCheck.CommissionCorrect,          tblTransactionCRSCheck.ContractRulesCorrect,          tblTransactionCRSCheck.ContractID from tblTransaction left join tblTransactionCRSCheck on     tblTransactionCRSCheck.AuditID = tblTransaction.AuditID and     tblTransactionCRSCheck.TransactionNumber = tblTransaction.TransactionNumber where tblTransaction.AuditID = 10001720 and     tblTransaction.ExcludedFromAudit = 'F' and     tblTransaction.SystemPricedFare = 'F' order by tblTransaction.FareBasis
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.sql.SQLException: Connection is closed
    GenerateAuditBatches.java sql 4 : select count(*) from tblTransaction where AuditID = 10001720 and     ExcludedFromAudit = 'F' and     SystemPricedFare = 'T'
    java.lang.Exception: Invalid handle [null] Database error code:0
         at com.select.auditlink.GenerateAuditBatches.batchTransactions(GenerateAuditBatches.java:966)
         at com.select.auditlink.GenerateAuditBatches.batchAudit(GenerateAuditBatches.java:449)
         at com.select.auditlink.GenerateAuditBatches.run(GenerateAuditBatches.java:172)
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.lang.Exception: Invalid handle [null] Database error code:0
    GenerateAuditBatches.java sql 5 transactions : select tblTransaction.BatchID,          tblTransaction.TransactionNumber,          tblTransaction.PrimeDocumentNumber,          tblTransaction.AgentIATACode,          tblTransaction.NetRemitInd,          tblTransaction.ITBTFare,          tblTransaction.TourCode,          tblTransaction.FareBasis,          tblTransaction.TransactionCode,          tblTransaction.TransactionCategory,          tblTransaction.InternationalOrDomestic,          tblTransaction.NumberOfSectors,          tblTransaction.TransactionStatus,          tblTransaction.TransactionStatusUserID,          tblTransactionCRSCheck.FareCorrect,          tblTransactionCRSCheck.TaxCorrect,          tblTransactionCRSCheck.CommissionCorrect,          tblTransactionCRSCheck.ContractRulesCorrect,          tblTransactionCRSCheck.ContractID from tblTransaction left join tblTransactionCRSCheck on     tblTransactionCRSCheck.AuditID = tblTransaction.AuditID and     tblTransactionCRSCheck.TransactionNumber = tblTransaction.TransactionNumber where tblTransaction.AuditID = 10001720 and     tblTransaction.ExcludedFromAudit = 'F' and     tblTransaction.SystemPricedFare = 'T' order by tblTransaction.FareBasis
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.sql.SQLException: Connection is closed
    GenerateAuditBatches.java sql 4 : select count(*) from tblTransaction where AuditID = 10001720 and     ExcludedFromAudit = 'F' and     SystemPricedFare = 'T'
    java.lang.Exception: Invalid handle [null] Database error code:0
         at com.select.auditlink.GenerateAuditBatches.batchTransactions(GenerateAuditBatches.java:966)
         at com.select.auditlink.GenerateAuditBatches.batchAudit(GenerateAuditBatches.java:454)
         at com.select.auditlink.GenerateAuditBatches.run(GenerateAuditBatches.java:172)
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.lang.Exception: Invalid handle [null] Database error code:0
    GenerateAuditBatches.java sql 5 transactions : select tblTransaction.BatchID,          tblTransaction.TransactionNumber,          tblTransaction.PrimeDocumentNumber,          tblTransaction.AgentIATACode,          tblTransaction.NetRemitInd,          tblTransaction.ITBTFare,          tblTransaction.TourCode,          tblTransaction.FareBasis,          tblTransaction.TransactionCode,          tblTransaction.TransactionCategory,          tblTransaction.InternationalOrDomestic,          tblTransaction.NumberOfSectors,          tblTransaction.TransactionStatus,          tblTransaction.TransactionStatusUserID,          tblTransactionCRSCheck.FareCorrect,          tblTransactionCRSCheck.TaxCorrect,          tblTransactionCRSCheck.CommissionCorrect,          tblTransactionCRSCheck.ContractRulesCorrect,          tblTransactionCRSCheck.ContractID from tblTransaction left join tblTransactionCRSCheck on     tblTransactionCRSCheck.AuditID = tblTransaction.AuditID and     tblTransactionCRSCheck.TransactionNumber = tblTransaction.TransactionNumber where tblTransaction.AuditID = 10001720 and     tblTransaction.ExcludedFromAudit = 'F' and     tblTransaction.SystemPricedFare = 'T' order by tblTransaction.FareBasis
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.sql.SQLException: Connection is closed
    GenerateAuditBatches.java sql 4 : select count(*) from tblTransaction where AuditID = 10001720 and     ExcludedFromAudit = 'F' and     SystemPricedFare = 'T'
    java.lang.Exception: Invalid handle [null] Database error code:0
         at com.select.auditlink.GenerateAuditBatches.batchTransactions(GenerateAuditBatches.java:966)
         at com.select.auditlink.GenerateAuditBatches.batchAudit(GenerateAuditBatches.java:459)
         at com.select.auditlink.GenerateAuditBatches.run(GenerateAuditBatches.java:172)
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.lang.Exception: Invalid handle [null] Database error code:0
    GenerateAuditBatches.java sql 5 transactions : select tblTransaction.BatchID,          tblTransaction.TransactionNumber,          tblTransaction.PrimeDocumentNumber,          tblTransaction.AgentIATACode,          tblTransaction.NetRemitInd,          tblTransaction.ITBTFare,          tblTransaction.TourCode,          tblTransaction.FareBasis,          tblTransaction.TransactionCode,          tblTransaction.TransactionCategory,          tblTransaction.InternationalOrDomestic,          tblTransaction.NumberOfSectors,          tblTransaction.TransactionStatus,          tblTransaction.TransactionStatusUserID,          tblTransactionCRSCheck.FareCorrect,          tblTransactionCRSCheck.TaxCorrect,          tblTransactionCRSCheck.CommissionCorrect,          tblTransactionCRSCheck.ContractRulesCorrect,          tblTransactionCRSCheck.ContractID from tblTransaction left join tblTransactionCRSCheck on     tblTransactionCRSCheck.AuditID = tblTransaction.AuditID and     tblTransactionCRSCheck.TransactionNumber = tblTransaction.TransactionNumber where tblTransaction.AuditID = 10001720 and     tblTransaction.ExcludedFromAudit = 'F' and     tblTransaction.SystemPricedFare = 'T' order by tblTransaction.FareBasis
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.sql.SQLException: Connection is closed
    GenerateAuditBatches.java sql 4 : select count(*) from tblTransaction where AuditID = 10001720 and     ExcludedFromAudit = 'F' and     SystemPricedFare = 'F'
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.lang.Exception: Invalid handle [null] Database error code:0
    java.lang.Exception: Invalid handle [null] Database error code:0
         at com.select.auditlink.GenerateAuditBatches.batchTransactions(GenerateAuditBatches.java:966)
         at com.select.auditlink.GenerateAuditBatches.batchAudit(GenerateAuditBatches.java:464)
         at com.select.auditlink.GenerateAuditBatches.run(GenerateAuditBatches.java:172)
    java.lang.Exception: Invalid handle [null] Database error code:0
         at com.select.auditlink.GenerateAuditBatches.batchTransactions(GenerateAuditBatches.java:966)
         at com.select.auditlink.GenerateAuditBatches.batchAudit(GenerateAuditBatches.java:469)
         at com.select.auditlink.GenerateAuditBatches.run(GenerateAuditBatches.java:172)
    GenerateAuditBatches.java sql 5 transactions : select tblTransaction.BatchID,          tblTransaction.TransactionNumber,          tblTransaction.PrimeDocumentNumber,          tblTransaction.AgentIATACode,          tblTransaction.NetRemitInd,          tblTransaction.ITBTFare,          tblTransaction.TourCode,          tblTransaction.FareBasis,          tblTransaction.TransactionCode,          tblTransaction.TransactionCategory,          tblTransaction.InternationalOrDomestic,          tblTransaction.NumberOfSectors,          tblTransaction.TransactionStatus,          tblTransaction.TransactionStatusUserID,          tblTransactionCRSCheck.FareCorrect,          tblTransactionCRSCheck.TaxCorrect,          tblTransactionCRSCheck.CommissionCorrect,          tblTransactionCRSCheck.ContractRulesCorrect,          tblTransactionCRSCheck.ContractID from tblTransaction left join tblTransactionCRSCheck on     tblTransactionCRSCheck.AuditID = tblTransaction.AuditID and     tblTransactionCRSCheck.TransactionNumber = tblTransaction.TransactionNumber where tblTransaction.AuditID = 10001720 and     tblTransaction.ExcludedFromAudit = 'F' and     tblTransaction.SystemPricedFare = 'F' order by tblTransaction.FareBasis
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.sql.SQLException: Connection is closed
    GenerateAuditBatches.java sql 4 : select count(*) from tblTransaction where AuditID = 10001720 and     ExcludedFromAudit = 'F' and     SystemPricedFare = 'F'
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.lang.Exception: Invalid handle [null] Database error code:0
    GenerateAuditBatches.java sql 5 transactions : select tblTransaction.BatchID,          tblTransaction.TransactionNumber,          tblTransaction.PrimeDocumentNumber,          tblTransaction.AgentIATACode,          tblTransaction.NetRemitInd,          tblTransaction.ITBTFare,          tblTransaction.TourCode,          tblTransaction.FareBasis,          tblTransaction.TransactionCode,          tblTransaction.TransactionCategory,          tblTransaction.InternationalOrDomestic,          tblTransaction.NumberOfSectors,          tblTransaction.TransactionStatus,          tblTransaction.TransactionStatusUserID,          tblTransactionCRSCheck.FareCorrect,          tblTransactionCRSCheck.TaxCorrect,          tblTransactionCRSCheck.CommissionCorrect,          tblTransactionCRSCheck.ContractRulesCorrect,          tblTransactionCRSCheck.ContractID from tblTransaction left join tblTransactionCRSCheck on     tblTransactionCRSCheck.AuditID = tblTransaction.AuditID and     tblTransactionCRSCheck.TransactionNumber = tblTransaction.TransactionNumber where tblTransaction.AuditID = 10001720 and     tblTransaction.ExcludedFromAudit = 'F' and     tblTransaction.SystemPricedFare = 'F' order by tblTransaction.FareBasis
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.sql.SQLException: Connection is closed
    GenerateAuditBatches.java sql 4 : select count(*) from tblTransaction where AuditID = 10001720 and     ExcludedFromAudit = 'F' and     SystemPricedFare = 'F'
    java.lang.Exception: Invalid handle [null] Database error code:0
         at com.select.auditlink.GenerateAuditBatches.batchTransactions(GenerateAuditBatches.java:966)
         at com.select.auditlink.GenerateAuditBatches.batchAudit(GenerateAuditBatches.java:474)
         at com.select.auditlink.GenerateAuditBatches.run(GenerateAuditBatches.java:172)
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.lang.Exception: Invalid handle [null] Database error code:0
    GenerateAuditBatches.java sql 5 transactions : select tblTransaction.BatchID,          tblTransaction.TransactionNumber,          tblTransaction.PrimeDocumentNumber,          tblTransaction.AgentIATACode,          tblTransaction.NetRemitInd,          tblTransaction.ITBTFare,          tblTransaction.TourCode,          tblTransaction.FareBasis,          tblTransaction.TransactionCode,          tblTransaction.TransactionCategory,          tblTransaction.InternationalOrDomestic,          tblTransaction.NumberOfSectors,          tblTransaction.TransactionStatus,          tblTransaction.TransactionStatusUserID,          tblTransactionCRSCheck.FareCorrect,          tblTransactionCRSCheck.TaxCorrect,          tblTransactionCRSCheck.CommissionCorrect,          tblTransactionCRSCheck.ContractRulesCorrect,          tblTransactionCRSCheck.ContractID from tblTransaction left join tblTransactionCRSCheck on     tblTransactionCRSCheck.AuditID = tblTransaction.AuditID and     tblTransactionCRSCheck.TransactionNumber = tblTransaction.TransactionNumber where tblTransaction.AuditID = 10001720 and     tblTransaction.ExcludedFromAudit = 'F' and     tblTransaction.SystemPricedFare = 'F' order by tblTransaction.FareBasis
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.sql.SQLException: Connection is closed
    GenerateAuditBatches.java sql 1 : update tblAudit set     NumberOfBatches = 1078 where AuditID = 10001720
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.sql.SQLException: Connection is closed
    GenerateAuditBatches.java sql 12 query2 : select BatchID from     tblAuditBatch where AuditID = 10001720
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.lang.Exception: Invalid handle [null] Database error code:0
    java.lang.Exception: Invalid handle [null] Database error code:0
         at com.select.auditlink.GenerateAuditBatches.updateAuditBatches(GenerateAuditBatches.java:1427)
         at com.select.auditlink.GenerateAuditBatches.run(GenerateAuditBatches.java:217)
    GenerateAuditBatches.java sql 2 : update tblAudit set     NumberOfAuditedBatches = (     select     count(*)     from     tblAuditBatch     where     AuditID = 10001720     and          NumberOfAuditedTransactions = NumberOfTransactions) where     AuditID = 10001720
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.sql.SQLException: Connection is closed
    GenerateAuditBatches.java sql 3 : update tblAudit set     NumberOfAuditedTransactions = (     select     count(*)     from     tblTransaction     where     AuditID = 10001720     and          Audited = 'T') where     AuditID = 10001720
    Exception :java.sql.SQLException: Invalid handle
    Exception :java.sql.SQLException: Connection is closed
    Exception :java.sql.SQLException: Connection is closed
    Please give me suitable solution of this issue.
    Thanks
    Rajnish
    Message was edited by:
    rajnishsunjava

    java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]File must be opened exclusively.
    In the Visual Foxpro table, I saw no READ ONLY settings.And also, there are
    no delete permission grants and there is no user database sesssion concept.
    The ODBC DSN for MYTABLE is setup as:
    - Free Tables (not database)
    - Null (checked)
    - Deleted (checked)If you're using Visual Foxpro database(.DBC), you should see "Exclusive" option too. You can try check it, but I don't know whether your issue will disappear.

  • Java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]Syntax error

    Hi all,
    I am able to INSERT and SELECT records from FoxPRo database successfully.
    The driver is Sun JDBC-ODBC bridge
    The DELETE statement throws no exception.
    I've tried to execute PACK after the DELETE call and got following exception:
    java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]File must be opened exclusively.So I tried USE MYTABLE EXCLUSIVE in a Statement before calling PACK and got the exception:
    java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]Syntax error or access violationI've also tried inserting the USE MYTABLE EXCLUSIVE before calling DELETE but got the same exception above.
    The ODBC DSN for MYTABLE is setup as:
    - Free Tables (not database)
    - Null (checked)
    - Deleted (checked)
    - Fetch data in background (checked)
    I am not able to issue any of the following commands to FoxPro using java
    OPEN - To open a table
    CLOSE - To close a table
    USE - To open a table for uer either in exclusive mode or shared mode
    The exception being generated is :
    java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]Syntax error or access violationThe help file of the Microsoft Visual Foxpro Driver states that the driver has support for the above commands.I a not able to get the way to issue the above commands to the driver using java.
    In setting up the ODBC DSN I saw no "read only" setting.
    In the Visual Foxpro table, I saw no READ ONLY settings.And also, there are no delete permission grants and there is no user database sesssion concept.
    I've tried all of the above with DSN mapped to a database(NOT free tables) and setting AUTO-COMMIT OFF and AUTO-COMMIT ON.But in vain. The same exceptions as those stated above persisted.
    Environment:
    Microsoft Windows XP Professional
    JDK version "1.4.2_09"
    Microsoft Visual Foxpro 06.00.8167
    Microsoft Visual Foxpro Driver 6.01.8629.01
    Don't know what else to try.
    Can anybody please help me.
    Thanks in advance
    Archana

    java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]File must be opened exclusively.
    In the Visual Foxpro table, I saw no READ ONLY settings.And also, there are
    no delete permission grants and there is no user database sesssion concept.
    The ODBC DSN for MYTABLE is setup as:
    - Free Tables (not database)
    - Null (checked)
    - Deleted (checked)If you're using Visual Foxpro database(.DBC), you should see "Exclusive" option too. You can try check it, but I don't know whether your issue will disappear.

  • Java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]

    I'm stuck for 2 days.
    Can anyone advise where I can find online/download what this error means when I run a jsp page to connect to SQL server?
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index

    Hi!
    I have found this post in another forum:
    David,
    I had a similar problem today, using the JDBC-ODBC driver to connect to
    Microsoft SQL Server 7. Apparently the order in which you retrieve columns
    can make a difference. I got this information from the following URL:
    http://enhydra.enhydra.org/project/mailingLists/enhydra/199911/msg00110.htm
    l
    I tried it in my application and it worked. Changing:
    result.setTitle(rs.getString("title"));
    result.setProducer(rs.getString("producer"));
    to:
    result.setProducer(rs.getString("producer"));
    result.setTitle(rs.getString("title"));
    made the exception disapear and now my code works fine. I still dont know
    exactly where the problem comes from.
    Hope this helps.
    Regards,
    Geri

  • Error:java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Connection

    Hi,
    while running jsp page i m getting error as follows:
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt..
    what is this error...
    what should i do to solve this problem...
    plz let me know what is this error & how to solve this...
    Thanx in advance....

    Why don't you do a search in google with the excpetion?
    If you cannot then try this link
    [http://www.idssoftware.com/faq-e.html]

  • Exception java.sql.SQLException: [Microsoft][ODBC Microsoft Access 97 Drive

    Hi,
    I am writing a simple program wihich will display the list of table for a given database. Currently I am using JDBC-ODBC bridge for accessing MS Acccess data base. When I call getTables method of DatabaseMetaData. Following Exception was thrown. Any clue what could be the reason for this?
    Exception java.sql.SQLException: [Microsoft][ODBC Microsoft Access 97 Driver]Driver not capable
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access 97 Driver]Driver not capable
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6106)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6263)
    at sun.jdbc.odbc.JdbcOdbc.SQLTables(JdbcOdbc.java:4917)
    at sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getTables(JdbcOdbcDatabaseMetaData.java:2395)
    at test.databaseMetaData.main(databaseMetaData.java:36)
    This exception occured in the following block:
         String[] strTables = {"TABLES"};
    rs = dbmd.getTables( null, "DBIS", "A%", strTables);
    Thanks in advance
    Cheers,
    Krishna

    Hi Krishna,
    First, do you have a correct ODBC setup on the platform your working on -- data source, etc.
    Second, please enclose the Java code for your connection, etc..
    Good luck!
    Francis

  • Java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]Optional fe

    Hello together!
    I am trying to add a long value to an access db.
    (I have a PreparedStatement.)
    But I get the following error:
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]Optional feature not implemented
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbc.SQLBindInParameterBigint(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setLong(Unknown Source)
         at Import.writeLineToDb(Import.java:70)
         at Import.main(Import.java:40)
    when exucuting the followint line:
    statement.setLong(2,new Long(data[1]).longValue());
    How can I find out which feature is missing and install it?
    Thanks.
    Markus

    Could it be that the driver is not installed for that?
    I am connecting like that:
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    connection = DriverManager.getConnection("jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ="+path, "", "");
    Thanks for your help.

  • Java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few...

    Can someone please help me? I get the error java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
    The offending section of code is:
    int resultsTableID = 0;
    query = "SELECT results_table_01 FROM dbo_results_table_01 WHERE image_1_id = '" + file1ID + "' AND image_2_id = '" + file2ID + "'";
    System.out.println(query);
    rs = s.executeQuery(query);
    The select statement comes out:
    SELECT results_table_01 FROM dbo_results_table_01 WHERE image_1_id = '115' AND image_2_id = '116'
    There does not seem to be a problem with the parameter separations, so if anyone can spot what I have done wrong I would appreciate it.
    Thanks

    I have just tried what you advised: Not using single quotes, and I got the same error.
    The query now looks like:
    query = "SELECT results_table_01 FROM dbo_results_table_01 WHERE image_1_id = " + file1ID + " AND image_2_id = " + file2ID;
    Thanks for your help, but it did not work.

  • Java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Invalid ar

    Hi, I'm getting an error in the eManager server log when running a load test:
    Error executing prepared statement: sun.jdbc.odbc.JdbcOdbcPreparedStatement@189ff39
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Invalid argument.
    I found this on the MS site concerning the 2GB size limitation for MDB files:
    http://support.microsoft.com/?id=835416
    The RSWReport.mdb file is more than 2GB in size, so I'm assuming that this file is causing the problem.
    Is there anyway to purge this file? Will compacting the file or splitting the file as MS recommends fix the problem?
    James

    You can always just create a new mdb file and run with that. I typically create a new MDB for each project I work on, or build of an app.
    The windows ODBC controls will let you create a blank MDB file.
    1. Start - Settings - Control Panel - Administrative Tools - Data Cources (ODBC)
    2. Chose the reporter ODBC - click configure - create. I tend to name by date and project, etc.
    3. In e-Load, chose Manage - Databases - New. In that window, chose 'Create e-Load tables in the database, give it a name, enter the DSN name, chose 'set as current e-Load database' and click ok.
    You should be good to go with a clean MDB file. If I missed a step or the instructions aren't clear let me know.
    SQL will give you better performance, but if its not an option managing the MDB files will help.
    - BT

  • Java.sql.SQLException: [Microsoft][ODBC Excel Driver] Syntax err

    Hi
    I am trying to implement the bulk data transfer from source(DB) and target(Excel File) but i am getting the below error.
    can some please help me on that.
    Knowledge USED:
    LKM SQL TO SQL
    IKM SQL INCREMENTAL UPDATE
    CODE:
    create table C$_0Sheet1
    *     C1_TEST     NUMBER(15)*
    ODI-1228: Task SrcSet0 (Loading) fails on the target MICROSOFT_EXCEL connection Ms_EXCE_TGT.
    Caused By: java.sql.SQLException: [Microsoft][ODBC Excel Driver] Syntax error in CREATE TABLE statement.
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957)
         at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114)
         at sun.jdbc.odbc.JdbcOdbc.SQLPrepare(JdbcOdbc.java:4830)
         at sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(JdbcOdbcConnection.java:475)
         at sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(JdbcOdbcConnection.java:443)
         at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at oracle.odi.core.datasource.dwgobject.support.OnConnectOnDisconnectDataSourceAdapter$OnDisconnectCommandExecutionHandler.invoke(OnConnectOnDisconnectDataSourceAdapter.java:200)
         at $Proxy2.prepareStatement(Unknown Source)
         at oracle.odi.runtime.agent.execution.sql.SQLCommand.doInitializeStatement(SQLCommand.java:83)
         at oracle.odi.runtime.agent.execution.sql.SQLCommand.getStatement(SQLCommand.java:117)
         at oracle.odi.runtime.agent.execution.sql.SQLCommand.getStatement(SQLCommand.java:111)
         at oracle.odi.runtime.agent.execution.sql.SQLCommand.execute(SQLCommand.java:158)
         at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:102)
         at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:1)
         at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:558)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:464)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
         at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
         at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
         at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
         at java.lang.Thread.run(Thread.java:662)

    Hi
    i refereed the blog and i modified the same but still it is throwing an error.
    ODI-1228: Task SrcSet0 (Loading) fails on the target MICROSOFT_EXCEL connection TGT_Excel_TEST.
    Caused By: java.sql.SQLException: [Microsoft][ODBC Excel Driver] Syntax error in CREATE TABLE statement.
    Code:
    create table C$_0POSITION_DEFINITION_ID
         C1_POSITION_DEFINITION_ID     NUMBER(15) ,
         C2_ID_FLEX_NUM___________     NUMBER(15)
    The above code is executed in the sql developer and it's successfully created the table.
    Edited by: 985498 on May 16, 2013 3:54 AM

  • Error: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]

    I am having a problem inserting/updateing date field of MS Access database with JDBC. I have tried several solutions. Serveral Field formats in the db and several methods with java. I will post my most recent attempt. I can read from the database I just can't write the date to the db, though I can write to any other field with a different datatype.
    Please don't bash me for using MS Access, it is my only option.
    Error: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]Error in row
    if (rs != null){
    while ( rs.next() ) {
    Date tDate;
              //Timestamp tDate;
              //String tDate;
    tDate = rs.getDate("Week");
              //tDate = rs.getTimestamp("Week");
              //tDate = rs.getString("Week");
              java.sql.Date sqlDate = new java.sql.Date( Date.getTime() );
              //java.sql.Timestamp sqlDate = new java.sql.Timestamp( tDate.getTime()
    System.out.println("Date: " + tDate );
    //System.out.println("Date: " + sqlDate );
    //System.out.println("Date: " + rs.getDate ("Date") );
    // 2004-03-24 00:00:00.0 this is Timestamp output
         Cpu.moveToInsertRow();
    Cpu.updateDate("Date_Col",sqlDate );
         //Cpu.updateDate("Date_Col",tDate );
         //Cpu.updateTimestamp("Date_Col", sqlDate);
         Cpu.insertRow();
    Error: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]Error in row
    Please help..........

    I can insert a new row and add all the fields (includeing date (as string)), but I have to use SQL statements. I cannot get the result set functions to work.
    I can retieve a rs just fine and print all the contents of the rs.
    My problem is with rs.updateRow();
    my code is below,
    public class Cpu_Load_Total_Cpu{
    public static void main(String[] args){
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String filename = "C:/dev/SHC/Cpu_Java/CFS_Health.mdb";
    String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
    database+= filename.trim() + ";DriverID=22;READONLY=false}";
    Connection con = DriverManager.getConnection( database ,"","");
    Statement stmt = con.createStatement(
    ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_UPDATABLE);
         ResultSet Cpu = stmt.executeQuery("SELECT * FROM Cpu");
    if (Cpu != null){
         while ( Cpu.next() ) {
                   int tUsr, tSys, tWio, tIdle, tTotal_Cpu;
                   tUsr = Cpu.getInt("Usr");
                   tSys = Cpu.getInt("Sys");
                   tWio = Cpu.getInt("Wio");
                   tIdle = 100 - (tSys + tUsr + tWio);
                   tTotal_Cpu = tSys + tUsr + tWio;
                   Cpu.updateLong(8, tTotal_Cpu);
    //or Cpu.updateLong("Total_Cpu", tTotal_Cpu);
    // I get the same error as the post above
    // when I include the Cpu.updateRow(); call
                   Cpu.updateRow();
    // when excluded everything else runs fine, but
    // the db is not updated
    // as stated, everything prints to the screen or pipe when
    // updateRow is excluded
                   System.out.println("Usr: " + tUsr );
                   System.out.println("Sys: " + tSys );
                   System.out.println("Wio: " + tWio);
                   System.out.println("Total_Cpu: " + tTotal_Cpu);
                        con.commit();
                   stmt.close();
                   con.close();
    catch (Exception e) {
    System.out.println("Error: " + e);
    }

Maybe you are looking for

  • Inventory onhand quantities Report.

    Hi Everyone, I have a requirement regarding Inventory, a report needs to show the details of inventory like Unusable_Quantity, Available_Quantity, Onhold_Quantity, Total Can any one help me in this. Regards Vamsi Edited by: 965678 on May 6, 2013 2:13

  • HT1491 how do i access my itunes wish list from iPad or iPhone?

    I cannot figure out how to access my wish list in iTunes on iPad. Is this feature not available on mobile devices?

  • TS3297 Help1221

    Problem problem problem why, when i buy the gems in game clash of clans and the system show to me is "Your purchase could not be completed" contact itune store support to complete this transaction. what dose it mean sir. please help me. iPhone 5

  • Problem with step off record

    Hi, Need to Create an Opportunity and step off the record. An error message should be thrown if the Probablity of the Opportunty is 0% and Sales Cycle is blank. like below I have written the code: function BusComp_PreWriteRecord () var prob; var stag

  • Unsupported query for Continuous Query Notification

    Hi all, I'm following an application which supports ADS(Active Data Service). http://www.consideringred.com/files/oracle/2011/ActiveDataServiceADFBCApp-v0.02.zip I build the application and it works well. Then I created a ViewCriteria for the same VO