Regarding java.sql.PreparedStatement

hi all,
Iam using mysql as backend and working using servlets/JSP's.i have been trying to find out datatypes of fields using ParameterMetaData Interface using PreparedStatement.But iam getting an error stating that it is not implemented in com.mysql.jdbc.NotImplemented:Feature not implemented.
Here is my code
                       Class.forName("org.gjt.mm.mysql.Driver");
                Connection con=DriverManager.getConnection("jdbc:mysql://localhost/"+"uniguru","root","");
                System.out.println("con="+con);
               PreparedStatement ps = con.prepareStatement("INSERT INTO linkstable VALUES(?, ?, ?,?)");
               try
                 ParameterMetaData pmd = ps.getParameterMetaData();
                 System.out.println("pmd="+pmd);
               for (int i = 1; i < pmd.getParameterCount(); i++)
                    System.out.println("Parameter number " + i);
                    System.out.println("  Class name is " + pmd.getParameterClassName(i));
                    // Note: Mode relates to input, output or inout
                    System.out.println("  Mode is " + pmd.getParameterClassName(i));
                    System.out.println("  Type is " + pmd.getParameterType(i));
                    System.out.println("  Type name is " + pmd.getParameterTypeName(i));
                    System.out.println("  Precision is " + pmd.getPrecision(i));
                    System.out.println("  Scale is " + pmd.getScale(i));
                    System.out.println("  Nullable? is " + pmd.isNullable(i));
                    System.out.println("  Signed? is " + pmd.isSigned(i));
               catch(SQLException e)
                    System.out.println(e);
               }Iam trying to write a generic servlet so as to insert any table values.Presently iam inserting values in a table named linkstable and i need to find out the datatypes.
Thanx in advance.

Have you tried to update to a newer driver?
It's the driver that says that the feature you are trying to use isn't implemented/supported by it.
Kaj

Similar Messages

  • Java.sql.PreparedStatement.setArray( ) not found in J2SE v1.3.1?

    Why do I get the error method setArray(int, Array) not found in interface java.sql.PreparedStatement? As per on-line documentation the method is available since version 1.2.
    In JDeveloper help I have read that...
    "JDeveloper uses J2SE definitions to describe an installed J2SE environment. This environment can be either a JRE (Java Runtime Engine) or an SDK. Note that if you are using a JRE, some features may not be available. Every JDeveloper project uses a J2SE definition to determine what version of the Java API to compile and run with."
    Is my problem because my JDeveloper installation is using a JRE and not an SDK?

    Sounds like a SQL problem. Not an expert in DB2 bu you might want to try INSERT INTO SESSION (col1name, col2name) VALUES (?,?);
    Edited by: Kungen on Sep 19, 2007 6:46 AM

  • SQL-text from java.sql.PreparedStatement ?

    If I have a java.sql.PreparedStatement object,
    is it somehow possible from that object to retrieve the last SQL-text statement that was executed or that it was associated with?

    I should add that if you're prepared to investigate "manually" then you can poke around in the driver as it does its thing using a debugger. You may well be able to find the string that way, but it's entirely dependent upon the driver implementation.
    Note that because a prepared statement typically represents a compiled object on the server end of the connection, there's no absolute requirement for it to retain this information at all - an identifier value will do just as well!

  • Java.sql.PreparedStatement#setUnicodeStream deprecated

    Hi all!
    The method setUnicodeStream of java.sql.PreparedStatement is set to deprecated without any comment since at least J2SE 1.3.1. Does anybody know what's the reason? Is there any alternative?
    Thanks in advance
    Carsten

    I've got a java.sql.date that I need to put into a
    calendar object. I was planning to use
    Calendar.set(date.getYear(), date.getMonth(),
    date.getDay()) but these methods are all deprecated
    now. Do I have to do date.toString() first, then
    parse out each value? This seems like a waste to me.
    btw - we use java.sql.date for our DB dates.What about Calendar.setTime(Date date)?

  • Any latest addition regarding java.sql.Date

    I have separate strings "10/21/2003" and "02:33:27".
    Just to convert String "10/21/2003" to sql date, do I really need to call up simple date format and parsing it?
    why? there is no time associated with this string. The time is on a separate string.
    I am using preparedstatement.

    Did I do unnecessary steps in getting to sql.Date ?
    String sDate = "10/16/2003";
    String sTime = "02:12:54:;
    String year = sDate.substring(6,9);
    String month = sDate.substring(0,1);
    String day = sDate.subst....
    String sDateNew = year + "-" + month + "-" + day;
    // the string becomes 2003-10-16.
    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd");
    java.util.Date uDate = sdf.parse(sDateNew);
    long time = uDate.getTime();
    java.sql.Date sqlDate = new java.sql.Date(time);
    pstmt.setDate(i, sqlDate);
    It works, but did I put in extra steps ?
    I tried using the same trick for sTime, but that did not work out.

  • Unable to insert dates and blobs with java.sql.PreparedStatement

    I got a problem when i try to insert into a table using Prepared
    statement.
    The table definition is
    TABLE USER_ACCOUNTS
    USER_ACCOUNT NUMBER(12),
    START_DATE DATE,
    END_DATE DATE,
    NB_UNSUCC_LOG_AT NUMBER(2),
    USER_ID VARCHAR2(30),
    CREATION_DATE DATE;
    In my java classes if i do the following code everithing's fine:
    connection = pool.getConnection();
    connection.executeUpdate("
    INSERT INTO USER_ACCOUNTS(
    USER_ACCOUNT,
    START_DATE,
    END_DATE,
    NB_UNSUCC_LOG_AT,
    USER_ID,
    CREATION_DATE)
    VALUES(
    123,
    TO_DATE('2001-11-20','YYYY-MM-DD'),
    NULL,
    0,
    'TOTO',
    TO_DATE('2001-11-20','YYYY-MM-DD')
    but when i do the following, it gives me errors and no rows are
    created! what am i doing wrong?
    connection = pool.getConnection();
    pstmt = connection.prepareStatement(
    "INSERT INTO USER_ACCOUNTS(
    USER_ACCOUNT,
    START_DATE,
    END_DATE,
    NB_UNSUCC_LOG_AT,
    USER_ID,
    CREATION_DATE)
    VALUES(?,?,?,?,?,?)");
    int userAccount = 123;
    java.sql.Date creationDate = new Date(123445566);
    java.sql.Date startDate = new Date(123445566);
    java.sql.Date endDate = null;
    int nbUnsuccessfullLogonAttempt = 0;
    String userid ="TOTO";
    pstmt.setInt(1, userAccount);
    pstmt.setDate(2, startDate);
    pstmt.setDate(3, endDate);
    pstmt.setInt(4, nbUnsuccessfullLogonAttempt);
    pstmt.setString(5, userid);
    pstmt.setDate(6, startDate);
    pstmt.executeUpdate();
    ____________ at this point i receive an SQL Exception that said
    invalid delimiter in string
    i also tried with VALUES
    (?,TO_DATE('?', 'YYYY-MM-DD'),?,?,?,TO_DATE('?', 'YYYY-MM-DD'))
    and the result was invalid month in date
    Thanks for your help!
    Julien De Santis

    > org.hibernate.PropertyValueException: not-null property references a null or transient value: BookOpr.Author.BkBk is null while it should not be, according to the mapping:
    <class name="BookOpr.Author" table="author">
        <many-to-one name="Bk" column="bid" class="BookOpr.Book" not-null="true"/>There are 2 solutions:
    1) Don't null the BookOpr.Author.Bk.
    2) Remove not-null="true" or set it to "false".

  • Java.sql.Date vs java.util.Date vs. java.util.Calendar

    All I want to do is create a java.sql.Date subclass which has the Date(String) constructor, some checks for values and a few other additional methods and that avoids deprecation warnings/errors.
    I am trying to write a wrapper for the java.sql.Date class that would allow a user to create a Date object using the methods:
    Date date1 = new Date(2003, 10, 7);ORDate date2 = new Date("2003-10-07");I am creating classes that mimic MySQL (and eventually other databases) column types in order to allow for data checking since MySQL does not force checks or throw errors as, say, Oracle can be set up to do. All the types EXCEPT the Date, Datetime, Timestamp and Time types for MySQL map nicely to and from java.sql.* objects through wrappers of one sort or another.
    Unfortunately, java.sql.Date, java.sql.Timestamp, java.sql.Time are not so friendly and very confusing.
    One of my problems is that new java.sql.Date(int,int,int); and new java.util.Date(int,int,int); are both deprecated, so if I use them, I get deprecation warnings (errors) on compile.
    Example:
    public class Date extends java.sql.Date implements RangedColumn {
      public static final String RANGE = "FROM '1000-01-01' to '8099-12-31'";
      public static final String TYPE = "DATE";
       * Minimum date allowed by <strong>MySQL</strong>. NOTE: This is a MySQL
       * limitation. Java allows dates from '0000-01-01' while MySQL only supports
       * dates from '1000-01-01'.
      public static final Date MIN_DATE = new Date(1000 + 1900,1,1);
       * Maximum date allowed by <strong>Java</strong>. NOTE: This is a Java limitation, not a MySQL
       * limitation. MySQL allows dates up to '9999-12-31' while Java only supports
       * dates to '8099-12-31'.
      public static final Date MAX_DATE = new Date(8099 + 1900,12,31);
      protected int _precision = 0;
      private java.sql.Date _date = null;
      public Date(int year, int month, int date) {
        // Deprecated, so I get deprecation warnings from the next line:
        super(year,month,date);
        if(! isWithinRange(this))
          throw new ValueOutOfRangeException((RangedColumn)this, "" + this);
      public Date(String s) {
        super(0l);
        // Start Cut-and-paste from java.sql.Date.valueOf(String s)
        int year;
        int month;
        int day;
        int firstDash;
        int secondDash;
        if (s == null) throw new java.lang.IllegalArgumentException();
        firstDash = s.indexOf('-');
        secondDash = s.indexOf('-', firstDash+1);
        if ((firstDash > 0) & (secondDash > 0) & (secondDash < s.length()-1)) {
          year = Integer.parseInt(s.substring(0, firstDash)) - 1900;
          month = Integer.parseInt(s.substring(firstDash+1, secondDash)) - 1;
          day = Integer.parseInt(s.substring(secondDash+1));
        } else {
          throw new java.lang.IllegalArgumentException();
        // End Cut-and-paste from java.sql.Date.valueOf(String s)
        // Next three lines are deprecated, causing warnings.
        this.setYear(year);
        this.setMonth(month);
        this.setDate(day);
        if(! isWithinRange(this))
          throw new ValueOutOfRangeException((RangedColumn)this, "" + this);
      public static boolean isWithinRange(Date date) {
        if(date.before(MIN_DATE))
          return false;
        if(date.after(MAX_DATE))
          return false;
        return true;
      public String getRange() { return RANGE; }
      public int getPrecision() { return _precision; }
      public String getType() { return TYPE; }
    }This works well, but it's deprecated. I don't see how I can use a java.util.Calendar object in stead without either essentially re-writing java.sql.Date almost entirely or losing the ability to be able to use java.sql.PreparedStatement.get[set]Date(int pos, java.sql.Date date);
    So at this point, I am at a loss.
    The deprecation documentation for constructor new Date(int,int,int)says "instead use the constructor Date(long date)", which I can't do unless I do a bunch of expensive String -> [Calendar/Date] -> Milliseconds conversions, and then I can't use "super()", so I'm back to re-writing the class again.
    I can't use setters like java.sql.Date.setYear(int) or java.util.setMonth(int) because they are deprecated too: "replaced by Calendar.set(Calendar.DAY_OF_MONTH, int date)". Well GREAT, I can't go from a Date object to a Calendar object, so how am I supposed to use the "Calendar.set(...)" method!?!? From where I'm sitting, this whole Date deprecation thing seems like a step backward not forward, especially in the java.sql.* realm.
    To prove my point, the non-deprecated method java.sql.Date.valueOf(String) USES the DEPRECATED constructor java.util.Date(int,int,int).
    So, how do I create a java.sql.Date subclass which has the Date(String) constructor that avoids deprecation warnings/errors?
    That's all I really want.
    HELP!

    I appreciate your help, but what I was hoping to accomplish was to have two constructors for my java.sql.Date subclass, one that took (int,int,int) and one that took ("yyyy-MM-dd"). From what I gather from your answers, you don't think it's possible. I would have to have a static instantiator method like:public static java.sql.Date createDate (int year, int month, int date) { ... } OR public static java.sql.Date createDate (String dateString) { ... }Is that correct?
    If it is, I have to go back to the drawing board since it breaks my constructor paradigm for all of my 20 or so other MySQL column objects and, well, that's not acceptable, so I might just keep my deprecations for now.
    -G

  • JDeveloper tutorial fails with java.sql.SQLException: ORA-00600

    In following the steps to the JDeveloper tutorial, after I successfully created and tested my connections, I proceeded on to run ImageLoader.java (Under DatabaseSetup.jws), and it returns an exception. The debug output log is as follows:
    Diagnostics: Routing diagnostics to standard output (use -Djbo.debugoutput=silent to remove)
    Successfully loaded properties file using: getResourceAsStream("/oracle/jbo/common/Diagnostic.properties");
    [00] Diagnostic Properties: Timing:false Functions:false Linecount:true Threshold:6
    [01] CommonMessageBundle (language base) being initialized
    [02] Stringmanager using default locale: 'null'
    [03] BC4JDeployPlatform: LOCAL
    [04] Propertymanager: searching for file and system based properties
    [05] {{ begin Loading BC4J properties
    [06] -----------------------------------------------------------
    [07] BC4J Property jbo.default.language='en' -->(MetaObjectManager) from System Default
    [08] BC4J Property jbo.default.country='US' -->(MetaObjectManager) from System Default
    [09] BC4J Property DeployPlatform='LOCAL' -->(SessionImpl) from Client Environment
    [10] Skipping empty Property ConnectionMode from System Default
    [11] Skipping empty Property HostName from System Default
    [12] Skipping empty Property ConnectionPort from System Default
    [13] Skipping empty Property ApplicationPath from System Default
    [14] Skipping empty Property java.naming.security.principal from System Default
    [15] Skipping empty Property java.naming.security.credentials from System Default
    [16] BC4J Property jbo.use.pers.coll='false' -->(SessionImpl) from System Default
    [17] BC4J Property jbo.pers.max.rows.per.node='70' -->(SessionImpl) from System Default
    [18] BC4J Property jbo.pers.max.active.nodes='10' -->(SessionImpl) from System Default
    [19] BC4J Property jbo.pcoll.mgr='oracle.jbo.pcoll.OraclePersistManager' -->(SessionImpl) from System Default
    [20] BC4J Property jbo.fetch.mode='AS.NEEDED' -->(MetaObjectManager) from System Default
    [21] Skipping empty Property JBODynamicObjectsPackage from System Default
    [22] BC4J Property MetaObjectContextFactory='oracle.jbo.server.xml.DefaultMomContextFactory' -->(MetaObjectManager) from /oracle/jbo/server/jboserver.properties resource
    [23] BC4J Property MetaObjectContext='oracle.jbo.server.xml.XMLContextImpl' -->(MetaObjectManager) from /oracle/jbo/server/jboserver.properties resource
    [24] BC4J Property java.naming.factory.initial='oracle.jbo.common.JboInitialContextFactory' -->(SessionImpl) from Client Environment
    [25] BC4J Property IsLazyLoadingTrue='true' -->(MetaObjectManager) from /oracle/jbo/server/jboserver.properties resource
    [26] BC4J Property ActivateSharedDataHandle='false' -->(MetaObjectManager) from System Default
    [27] Skipping empty Property HandleName from System Default
    [28] Skipping empty Property Factory-Substitution-List from System Default
    [29] Skipping empty Property jbo.project from System Default
    [30] BC4J Property jbo.max.cursors='50' -->(MetaObjectManager) from System Default
    [31] BC4J Property jbo.dofailover='true' -->(MetaObjectManager) from System Default
    [32] BC4J Property jbo.doconnectionpooling='false' -->(MetaObjectManager) from System Default
    [33] BC4J Property jbo.recyclethreshold='10' -->(MetaObjectManager) from System Default
    [34] BC4J Property jbo.passivationstore='null' -->(MetaObjectManager) from System Default
    [35] BC4J Property RELEASE_MODE='Reserved' -->(MetaObjectManager) from System Default
    [36] BC4J Property jbo.maxpoolcookieage='-1' -->(MetaObjectManager) from System Default
    [37] Skipping empty Property PoolClassName from System Default
    [38] BC4J Property jbo.maxpoolsize='2147483647' -->(MetaObjectManager) from System Default
    [39] BC4J Property jbo.initpoolsize='0' -->(MetaObjectManager) from System Default
    [40] BC4J Property jbo.poolrequesttimeout='30000' -->(MetaObjectManager) from System Default
    [41] BC4J Property jbo.assoc.consistent='true' -->(MetaObjectManager) from System Default
    [42] BC4J Property jbo.SQLBuilder='Oracle' -->(MetaObjectManager) from /oracle/jbo/server/jboserver.properties resource
    [43] BC4J Property jbo.ConnectionPoolManager='oracle.jbo.server.ConnectionPoolManagerImpl' -->(MetaObjectManager) from System Default
    [44] BC4J Property jbo.TypeMapEntries='Oracle' -->(MetaObjectManager) from /oracle/jbo/server/jboserver.properties resource
    [45] BC4J Property jbo.jdbc.trace='false' -->(MetaObjectManager) from System Default
    [46] BC4J Property oracle.jbo.defineColumnLength='true' -->(MetaObjectManager) from System Default
    [47] Skipping empty Property jbo.tmpdir from System Default
    [48] Skipping empty Property jbo.server.internal_connection from System Default
    [49] Skipping empty Property SessionClass from System Default
    [50] Skipping empty Property TransactionFactory from System Default
    [51] BC4J Property jbo.debugoutput='console' -->(Diagnostic) from System Property
    [52] BC4J Property jbo.debug.prefix='DBG' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
    [53] BC4J Property jbo.logging.show.timing='false' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
    [54] BC4J Property jbo.logging.show.function='false' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
    [55] BC4J Property jbo.logging.show.level='false' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
    [56] BC4J Property jbo.logging.show.linecount='true' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
    [57] BC4J Property jbo.logging.trace.threshold='6' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
    [58] BC4J Property jbo.jdbc.driver.verbose='false' -->(Diagnostic) from System Default
    [59] BC4J Property jbo.ejb.txntimeout='60' -->(SessionImpl) from System Default
    [60] BC4J Property jbo.ejb.txntype='global' -->(MetaObjectManager) from System Default
    [61] Skipping empty Property oracle.jbo.schema from System Default
    [62] WARNING: Unused property: LC='Calling Function' found in /oracle/jbo/common/Diagnostic.properties resource
    [63] }} finished loading BC4J properties
    [64] -----------------------------------------------------------
    Diagnostics: Routing diagnostics to standard output (use -Djbo.debugoutput=silent to remove)
    [65] Diagnostic Properties: Timing:false Functions:false Linecount:true Threshold:6
    [66] JavaVMVersion: 1.2.351 odv
    [67] JavaVMVendor: Oracle Corp.
    [68] JavaVMName: OJVM VM
    [69] OperatingSystemName: Windows NT
    [70] OperatingSystemVersion: 5.0
    [71] OperatingSystemUsername: Administrator
    [72] Connected to Oracle JBO Server - Version: 3.2.9.76.3
    [73] {{+++ id=10000 type: 'BC4J_CREATE_ROOTAM' Create Root Application Module 'ImageLoader.ImageLoaderModule'
    [74] {{+++ id=10001 type: 'METAOBJECT_LOAD' Loading meta-object: ImageLoader.ImageLoaderModule
    [75] {{+++ id=10002 type: 'METAOBJECT_LOAD' Loading meta-object: ImageLoader.ImageLoader
    [76] Loading from /ImageLoader/ImageLoader.xml file
    [77] Loading from indvidual XML files
    [78] Loading the Containees for the Package 'ImageLoader.ImageLoader'.
    [79] }}+++ End Event10003 null
    [80] Loading from /ImageLoader/ImageLoaderModule.xml file
    [81] }}+++ End Event10002 null
    [82] {{+++ id=10003 type: 'METAOBJECT_LOAD' Loading meta-object: ImageLoader.InventoryItem1View
    [83] Loading from /ImageLoader/InventoryItem1View.xml file
    [84] ViewObjectImpl's default fetch mode = 0
    [85] {{+++ id=10004 type: 'METAOBJECT_LOAD' Loading meta-object: ImageLoader.InventoryItem
    [86] Loading from /ImageLoader/InventoryItem.xml file
    [87] Loading Typemap entries from oracle.jbo.server.OracleTypeMapEntries
    [88] CSMessageBundle (language base) being initialized
    [89] }}+++ End Event10005 null
    [90] OracleSQLBuilder reached getInterface
    [91] Oracle SQL Builder Version 3.2.0.0.0
    [92] }}+++ End Event10004 null
    [93] {{+++ id=10005 type: 'BC4J_CREATE_VIEWOBJECT' Create ViewObject 'InventoryItem1View'
    [94] }}+++ End Event10006 null
    [95] Created root application module: 'ImageLoader.ImageLoaderModule'
    [96] Locale is: 'en_US'
    [97] }}+++ End Event10001 null
    [98] Using DatabaseTransactionFactory implementation oracle.jbo.server.DatabaseTransactionFactory
    [99] DBTransactionImpl Max Cursors is 50
    [100] Oracle SQLBuilder: Registered driver: oracle.jdbc.driver.OracleDriver
    [101] {{+++ id=10006 type: 'JDBC_CONNECT' null
    [102] Trying connection/1: url='jdbc:oracle:thin:bc4j/bc4j@localhost:1521:oracle9i'...
    [103] }}+++ End Event10007 null
    [104] Successfully logged in
    [105] JDBCDriverVersion: 8.1.7.0.0
    [106] DatabaseProductName: Oracle
    [107] DatabaseProductVersion: Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production With the Partitioning option JServer Release 9.0.1.1.1 - Production
    [108] Column count: 8
    [109] {{+++ id=10007 type: 'EXECUTE_QUERY' ViewObject executeQueryForCollection InventoryItem1View
    [110] {{+++ id=10008 type: 'VIEWOBJECT_GETSTATEMENT' Viewobject: InventoryItem1View getting prepared statement
    [111] ViewObject : Created new QUERY statement
    [112] SELECT InventoryItem.ID, InventoryItem.NAME, InventoryItem.DESCRIPTION, InventoryItem.IMAGE, InventoryItem.PRICE, InventoryItem.ONHAND, InventoryItem.SUPPLIER_ID, InventoryItem.CATEGORY_ID FROM INVENTORY_ITEM InventoryItem
    [113] {{+++ id=10009 type: 'JDBC_CREATE_STATEMENT' createPreparedStatement - prefetch size: 1
    [114] }}+++ End Event10010 null
    [115] }}+++ End Event10009 ViewObject : Creating new QUERY statementSELECT InventoryItem.ID, InventoryItem.NAME, InventoryItem.DESCRIPTION, InventoryItem.IMAGE, InventoryItem.PRICE, InventoryItem.ONHAND, InventoryItem.SUPPLIER_ID, InventoryItem.CATEGORY_ID FROM INVENTORY_ITEM InventoryItem
    [116] QueryCollection.executeQuery failed...
    [117] java.sql.SQLException: ORA-00600: internal error code, arguments: [ttcgcshnd-1], [0], [], [], [], [], [], []
         java.lang.Class java.net.URLClassLoader.findClass(java.lang.String)
         java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean)
         java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean)
         java.lang.Class sun.misc.Launcher$AppClassLoader.loadClass(java.lang.String, boolean)
         java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String)
         java.util.Enumeration oracle.jbo.common.WeakHashtableImpl.elements()
         java.util.Enumeration oracle.jbo.common.WeakHashtable.elements()
         void oracle.jbo.server.ViewObjectImpl.freeStatement(java.sql.PreparedStatement, boolean)
         void oracle.jbo.server.QueryCollection.executeQuery(java.lang.Object[], int)
         void oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(java.lang.Object, java.lang.Object[], int)
         void oracle.jbo.server.ViewRowSetImpl.execute(boolean, boolean)
         void oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed()
         boolean oracle.jbo.server.ViewRowSetIteratorImpl.hasNext()
         boolean oracle.jbo.server.ViewRowSetImpl.hasNext()
         boolean oracle.jbo.server.ViewObjectImpl.hasNext()
         void ImageLoader.ImageLoader.main(java.lang.String[])
    [118] SELECT InventoryItem.ID, InventoryItem.NAME, InventoryItem.DESCRIPTION, InventoryItem.IMAGE, InventoryItem.PRICE, InventoryItem.ONHAND, InventoryItem.SUPPLIER_ID, InventoryItem.CATEGORY_ID FROM INVENTORY_ITEM InventoryItem
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT InventoryItem.ID, InventoryItem.NAME, InventoryItem.DESCRIPTION, InventoryItem.IMAGE, InventoryItem.PRICE, InventoryItem.ONHAND, InventoryItem.SUPPLIER_ID, InventoryItem.CATEGORY_ID FROM INVENTORY_ITEM InventoryItem
         void oracle.jbo.server.ViewRowSetImpl.execute(boolean, boolean)
         void oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed()
         boolean oracle.jbo.server.ViewRowSetIteratorImpl.hasNext()
         boolean oracle.jbo.server.ViewRowSetImpl.hasNext()
         boolean oracle.jbo.server.ViewObjectImpl.hasNext()
         void ImageLoader.ImageLoader.main(java.lang.String[])
    ## Detail 0 ##
    java.sql.SQLException: ORA-00600: internal error code, arguments: [ttcgcshnd-1], [0], [], [], [], [], [], []
         void oracle.jbo.server.ViewRowSetImpl.execute(boolean, boolean)
         void oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed()
         boolean oracle.jbo.server.ViewRowSetIteratorImpl.hasNext()
         boolean oracle.jbo.server.ViewRowSetImpl.hasNext()
         boolean oracle.jbo.server.ViewObjectImpl.hasNext()
         void ImageLoader.ImageLoader.main(java.lang.String[])
    Exception in thread main
    At first I thought maybe this is a configuration specific problem -- but I was able to replicate this on two separate machine with clean Win2K and Oracle9i installs.
    It seems like it is not finding a particular class, which leads me to believe that some particular jar is probably missing -- can anyone help me figure out which one? Or is there something else that may be going wrong?
    TIA

    You need to make sure you're using the Oracle9i JDBC driver, or using the Oracle 8.1.7.2 JDBC driver as I mentioned above.
    If you are using JDeveloper9i release 9.0.2 or 9.0.3, the driver you need is in <jdevhome>\jdbc\lib
    Otherwise, you can also download the drivers from OTN.

  • Java.sql.PreparedStament

    when i use the java.sql.statement i cant create it with scrollable property. like this:
    // Create a Statement object that will be used to excecute the query.
    // The arguments specify that the returned ResultSet will be
    // scrollable, read-only, and insensitive to changes in the db.
    Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
    // Run the query, creating a ResultSet
    ResultSet r = statement.executeQuery(query);
    the java.sql.PreparedStatement is scrollable or can be ???
    regards

    Connection class has this method (signature copied and pasted from my 1.3 javadoc):
    public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException

  • Java.sql.SQLException: ORA-01000: maximum open cursors exceeded ORA-06512:

    Please help me for resolving this Error.
    I got This Error while Web Load TEsting.
    java.sql.SQLException: ORA-01000: maximum open cursors exceeded ORA-06512: at "IADMIN.ADM_ADMIN_ISMART_PCK", line 269 ORA-06512: at line 1

    I also faced similar problem - and solved as following:
    java.sql.PreparedStatement pStmt = null;
    ResultSet rs, rs_opr;
    try {
         query = "select ..."
         pStmt = conn.prepareStatement (query); // first instance of the PreparedStatement
         pStmt.setInt (1, rq_count);
         pStmt.setString (2, rqid);
         rs = pStmt.executeQuery ();
         if (rs.next()) {
              plant_nm = rs.getString("PLANT_NM");
         rs.close();
         pStmt.close(); // this was done only at the last time (added here and solved)
         query = "select ..."
         pStmt = conn.prepareStatement (query); // second instance of the PreparedStatement
         pStmt.setInt (1, rq_count);
         pStmt.setString (2, rqid);
         rs = pStmt.executeQuery ();
         if (rs.next()) {
              Var2 = rs.getString("Vari1ble_2");
         rs.close();
         pStmt.close(); // this was done only at the last time (added here and solved)
         query = "select ..."
         pStmt = conn.prepareStatement (query); // third instance of the PreparedStatement
         pStmt.setInt (1, rq_count);
         pStmt.setString (2, rqid);
         rs = pStmt.executeQuery ();
         if (rs.next()) {
              Var3 = rs.getString("Variable_3");
         rs.close();
         pStmt.close(); // this was done only here -- added 2 times as above
    }

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

    i am trying to execute the following query using jdbc
    String state = "select * from cs_test where Start_Time < DateAdd(\"s\",-19800,now()) AND End_Time >
    DateAdd(\"s\",-19800,now())";
    /java.sql.PreparedStatement querycs_test = c.prepareStatement(state);
    java.sql.Statement querycs_test= c.createStatement();
    java.sql.ResultSet rs = querycs_test.executeQuery(state);
    when i run the same query at the prompt in MS Access it works fine.
    The same line replaced with a simpler query works fine.
    but when i run the above i get an error
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

    Here's the value of your query before preparing it:
    select * from cs_test where Start_Time < DateAdd("s",-19800,now()) AND End_Time > DateAdd("s",-19800,now())My SQL refererence doesn't have anything about functions called DateAdd or now. It might be Microsoft specific, in which case when your organization converts to another database your query is going to stop working. Don't use vender specific extensions.
    Was your intention to call a Java method called DateAdd or now? Then your problem is a few missing quotes. Otherwise, I'm sorry I can't be of more help.

  • Error IllegalArgumentException in java.sql.Date used PreparedStatement

    I'm found bug (probably). I have a table with column DATA type. Now I connect do database use JDBC in Java, and create PreparedStatement:
    PreparedStatement stmt = conn.prepareStatement("insert into \"Appuser\" (\"IDUser\", \"createAccountDate\") values (?,?)");
    Column createAccountDate is a DATA type. And now I invoke:
    stmt.setInt(1, 1);
    stmt.setInt(2, new java.sql.Date(-2508265596206959779));
    stmt.execute();
    and last line return exception:
    java.lang.IllegalArgumentException
    at sun.util.calendar.ZoneInfo.getOffset(ZoneInfo.java:368)
    at oracle.jdbc.driver.DateCommonBinder.zoneOffset(OraclePreparedStatement.java:15423)
    at oracle.jdbc.driver.DateCommonBinder.setOracleCYMD(OraclePreparedStatement.java:15561)
    at oracle.jdbc.driver.DateBinder.bind(OraclePreparedStatement.java:15641)
    at oracle.jdbc.driver.OraclePreparedStatement.setupBindBuffers(OraclePreparedStatement.java:2866)
    at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:2151)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3280)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3390)
    at // line stmt.execute();
    Another values of Data are OK. Probably value -2508265596206959779 cause that error.
    It's a bug? Better will be SQLException if it is a bug.
    My configuration:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE     10.2.0.1.0     Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Windows XP SP3, Java 1.6.0_20,
    ojdbc14.jar, Oracle JDBC Driver version - "10.2.0.1.0XE

    Probably value -2508265596206959779 cause that errorMaybe, whatever that .date( -ReallyLotsOfmSec ) date values is, pretty sure its outside the valid values for a date column, 4712BC to 9999AD is the min/max.
    Perhaps the java code can handle it, an oracle date type can not.

  • PreparedStatement.setDate(new java.sql.Date(long))

    Anyone knows how to set insert a Date with Time, Day, Year into a database? I have tried using the preparedStatement.setDate(new java.sql.Date(long)) but it only inserts yyyy mm dd but I want to include time too.
    Anyone knows how here? Please advice.

    how to create an instance of Timestamp?
    new java.sql.Timestamp(????)
    What to put in the parameter?I think that I might have answered that in another one of your posts, if not could you elaborate your problem
    http://forum.java.sun.com/thread.jsp?forum=31&thread=165123

  • PreparedStatement.setDate(1,java.sql.Date x) problem

    I am using Sun JDBC-ODBC bridge to access MS SQL Server 2000. I have following statement:
    java.util.Date date = new java.util.Date();
    java.sql.Date expire_date = new java.sql.Date(date.getTime());
    PreparedStatement pstat = con.prepareStatement("update account set expire_date=? where userid=?");
    pstat.setDate(1,expire_date);
    pstat.setString(2,userid);
    When I ran the program, I got a SQLException error as
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Optional features not implemented.
    I have traced the problem happened in the statement pstat.setDate(1,expire_date). I use jdbc-odbc bridge from j2se 1.3.1.
    I appreciate any help.
    Thanks, Brian

    May I refer to a recent topic where I explained a lot about date conversion between JDBC and SQLServer?
    http://forum.java.sun.com/thread.jsp?forum=48&thread=241049
    Try how far this helps you, then ask more.

  • Regarding Internal Exception: java.sql.SQLException

    While deploying the application we are encounter a following error,
    Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: FATAL: sorry, too many clients already
    Error Code: 0
    Deployment error:
    Please give me a suggession for this error.
    Thanks,

    While deploying the application we are encounter a following error,
    Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: FATAL: sorry, too many clients already
    Error Code: 0
    Deployment error:
    Please give me a suggession for this error.
    Thanks,

Maybe you are looking for

  • CLIPBOARD_EXPORT method of CL_GUI_FRONTEND_SERVICES

    Hello All, I am using the CLIPBOARD_EXPORT  method of CL_GUI_FRONTEND_SERVICES class to copy the content of the EXCEL sheet to the clipboard, which I later append in an Internal Table. The problem I face is that the EXCEL sheet is very huge and while

  • Does the Intel 82579LM NIC on the Portege R830 support Promiscuous mode?

    Hi, I've got a work laptop (Portege R830), which doesn't want to sniff packets. I've got it connected to a Netgear Hub (DS104), along with an older notebook, and then uplink to ADSL. Running a continuous ping to the default gateway and Wireshark on b

  • Please Help... datagrid display double..

    i have 7 frames, each frame contain 1 datagrid(instance name "datagrid" for all datagrid. i put this code in each frame.. frame 1 datagrid.addColumn("Name"); datagrid.addColumn("Address"); datagrid.addColumn("Phone"); datagrid.addItem({Name:"John", A

  • Style Sheet XML Pub

    Hi, How can we download the XSL style sheets from xml publisher admin responsibility and modify according to our customizations?? Style Sheets (Sourcing Style sheet, Standard Purchase Order Style sheet) for the Document Types(Sourcing RFQ Sourcing RF

  • Personal profile && midp

    dear all : J2ME wireless tool kit provides midp. but i need libraries like java.awt.*, so i need personal profile. the problem is that how i combine personal profile with midp ? thx you ^^"