Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Other Java > Java Databases
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 07:09 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.