Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java Databases
| Search | Today's Posts | Mark Forums Read
Java Databases Discussion specific to working with Java Databases. For other Java topics, please see related Java forums. For database discussions not specific to Java, please see the Database category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 10th, 2004, 05:38 AM
Registered User
 
Join Date: Aug 2004
Location: kuala lumpur, , Malaysia.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Encounter ORA-00933 when use RETURN_GENERATED_KEYS

Hi All,

I working on data conversion using java (JDeveloper Tool).

I base on Expert One-on-One J2EE Design and Development page : 273 Chapter 7 to work for solution .

I encounter problem below:

ORA-00933: SQL command not properly ended

script as below :

public long insertAcctTelephone(Connections conn, Connection oConn,
                              long holderIdNo, String telNo, String telTypeCode )

  {
    PreparedStatement oPr = null;
    ResultSet rs = null;
String oSql = "INSERT INTO telephone (" +
                  " investorid, telno, " +
                      " teltypecode) " +
                  " values (?, ?, ?),Statement.RETURN_GENERATED_KEYS";

    try{
      oPr = oConn.prepareStatement(oSql); //oPr = conn.updateOracleSQL(oConn, oSql);

    } catch (Exception eo)
      {
        System.out.println(" PreparedStatement " + eo.getMessage());
        conn.OracleErrEncounter(oConn," PreparedStatement " + eo.getMessage());
      }
    System.out.println("holderIdNo " + Long.toString(holderIdNo));
    System.out.println("telNo " + telNo);
    System.out.println("telTypeCode " + telTypeCode);

    try{
        oPr.setLong(1,holderIdNo);
        oPr.setString(2,telNo);
        oPr.setString(3, telTypeCode );
        } catch (Exception zd)
        {
          System.out.println("YES THIS IS " + zd.getMessage());
        }
        try{
        oPr.executeUpdate();
        } catch (Exception www)
          {
            [u]System.out.println("OUT " + www.getMessage());</u>

          }
          try{
            rs = oPr.getGeneratedKeys();
             }catch(Exception zde)
              { System.out.println("OUT III " + zde.getMessage());}
          try{
             if (rs.next())
             {
               long key = rs.getLong(1);
               return key;
             }
             }catch (Exception ioe)
               { System.out.println("OUT IV " + ioe.getMessage());}

         return -1;

  }


*****************
the process terminate at Exception OUT

Hope to get your reply soon.
Thank you so much.




Similar Threads
Thread Thread Starter Forum Replies Last Post
I encounter some problems when ... wishstar99 BOOK: Professional WCF Programming: .NET Dev with Windows Communication Found ISBN: 9780470089842 15 July 29th, 2008 11:07 AM
Hi all I encounter a prob while passing values.. geethan85 BOOK: Beginning Ruby on Rails 0 May 14th, 2007 01:17 AM
ORA-0134 db009 Oracle 0 February 23rd, 2007 06:04 AM
[Oracle][ODBC][Ora][ORA-01013 Corey Access 1 December 15th, 2006 10:29 AM
Need help to Resolve Error ORA-00933 sandeepshivathaya Oracle 0 August 19th, 2004 07:15 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.