Oracle driver NullPointerException

Discussion in 'Java' started by timjowers, Nov 2, 2007.

  1. timjowers

    timjowers Guest

    Running this code across lots of tables in Oracle and it works fine in
    MySQL, Postgres, and for some tables in Oracle. Anyhoo, let me know if
    you have insight on the following. I went to ORCL's site but did not
    see any easy way to report the bug.

    table: ORA_KGLR7_IDL_SB4
    String select = "select * from " + table + " WHERE 1 = 0";
    rs = stmt.executeQuery(select); ...

    Exception in thread "main" java.lang.NullPointerException
    at oracle.jdbc.driver.T4CTTIdcb.fillupAccessors(T4CTTIdcb.java:726)
    at oracle.jdbc.driver.T4CTTIdcb.receiveCommon(T4CTTIdcb.java:184)
    at oracle.jdbc.driver.T4CTTIdcb.receive(T4CTTIdcb.java:97)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:594)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:113)
    at
    oracle.jdbc.driver.T4CStatement.execute_for_describe(T4CStatement.java:
    431)
    at
    oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:
    942)
    at
    oracle.jdbc.driver.T4CStatement.execute_maybe_describe(T4CStatement.java:
    463)
    at
    oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:
    1037)
    at
    oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:
    1183)
    at db2web.DBInfo.getTables(DBInfo.java:94)
    at db2web.TableToWeb.retrieveTables(TableToWeb.java:73)
    at db2web.TableToWeb.main(TableToWeb.java:106)
     
    timjowers, Nov 2, 2007
    #1
    1. Advertising

  2. timjowers

    Roedy Green Guest

    On Fri, 02 Nov 2007 15:42:42 -0000, timjowers <>
    wrote, quoted or indirectly quoted someone who said :

    >String select = "select * from " + table + " WHERE 1 = 0";
    >rs = stmt.executeQuery(select); ...


    since 1 is never 0, why are you doing this? It should return nothing.
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Nov 3, 2007
    #2
    1. Advertising

  3. On Nov 3, 2:13 pm, Roedy Green <>
    wrote:
    > On Fri, 02 Nov 2007 15:42:42 -0000, timjowers <>
    > wrote, quoted or indirectly quoted someone who said :
    >
    > >String select = "select * from " + table + " WHERE 1 = 0";
    > >rs = stmt.executeQuery(select); ...

    >
    > since 1 is never 0, why are you doing this? It should return nothing.


    It is a special trick/query used to return all the columns
    in a table without any data, but I can't see its immediate
    validity in this context.

    It is normally used to create a copy of a table without data.

    --
    Chris
     
    Chris ( Val ), Nov 3, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chads Ford
    Replies:
    0
    Views:
    393
    Chads Ford
    Aug 16, 2003
  2. YZ
    Replies:
    0
    Views:
    427
  3. Cookie Monster

    writing clobs using oracle thin driver

    Cookie Monster, Nov 11, 2004, in forum: Java
    Replies:
    2
    Views:
    2,728
    steve
    Nov 13, 2004
  4. Betty
    Replies:
    1
    Views:
    9,933
    Juha Laiho
    May 21, 2005
  5. Feyruz
    Replies:
    4
    Views:
    2,340
    Sherm Pendley
    Oct 14, 2005
Loading...

Share This Page