Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: JDBC question -- CORRECTION
I just read my own reply and here is correction to what I meant to say:
As far as the issue goes. There are 2 options:
1 Option) It's a bug in 8.1.5 and 8.1.6 version of JDBC drivers that he got
(get
the latest patch from technet)
This is unlikely -- since prepared statements is a very basic functionality and would be tested I would assume thoroughly before being shipped out.
2 Option) He is using JDK1.1 instead of JDK1.2 which 8.1.5 and 8.1.6
drivers are
meant for.
In other words, for him to be able to use 8.1.5/8.1.6 drivers he needs to compile and run his app with JDK1.2.
Sorry for the confusion.
Val Gamerman.
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> cc: (bcc: Val Gamerman/Victoria Financial) From: "Val_Gamerman/Victoria_Financial.VICTORIA_FINANCIAL"@lnn.com @ NOTES NET Date: 08/09/2000 09:03:03 PM GMT
It is a valid syntax for JDBC. The prepare call will take care of passing
this sql statement to Oracle in the right format.
As far as the issue goes:
1) It's a bug in 8.1.5 and 8.1.6 version of JDBC drivers that he got (get
the latest patch from technet)
2) He is using JDK1.1 instead of JDK1.2 which 8.1.5 and 8.1.6 drivers are
meant for.
In other words, for him to be able to use 8.1.5/8.1.6 drivers he needs
to compile and run his app with JDK1.2.
Val Gamerman
Oracle DBA
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> cc: (bcc: Val Gamerman/Victoria Financial) Date: 08/09/2000 07:55:11 PM GMT
I don't know java, either.
But in java, is this legal SQL syntax? "where divid = ?";
Tom Harleman
11080 Willowmere Dr.
Indianapolis, IN 46280
317-844-2884 Home 317-843-9122 Home Office -----Original Message-----
public static void main(String argv[]) throws Exception { Class.forName("oracle.jdbc.driver.OracleDriver") ; Connection conn = DriverManager.getConnection( "jdbc:oracle:thin:@rocky:1521:PSS", "pss", "psspwd"); String divId = "93" ; String query = "select min(finyear) " + "from sector_target_balances " + "where divid = ?"; PreparedStatement mainStmt = conn.prepareStatement(query) ; mainStmt.setString(1, divId); ResultSet mainResult = mainStmt.executeQuery(query) ; String minFinYear="", maxFinYear=""; while (mainResult.next()) { // for each row minFinYear = mainResult.getString(1); maxFinYear = mainResult.getString(2); } // next row System.out.println("minFinYear "+ minFinYear + "maxFinYear"
conn.close(); }
at java.lang.Throwable.fillInStackTrace(Native Method) at java.lang.Throwable.fillInStackTrace(Compiled Code) at java.lang.Throwable.<init>(Compiled Code) at java.lang.Exception.<init>(Exception.java:42) at java.sql.SQLException.<init>(SQLException.java:43) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114) at oracle.jdbc.ttc7.TTIoer.processError(Compiled Code) at oracle.jdbc.ttc7.Oall7.receive(Compiled Code) at oracle.jdbc.ttc7.TTC7Protocol.doOall7(Compiled Code) at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:595) at
at
oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:1758)
at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.jav
a
:1805)
at
oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:410)
at TestOraclePrepStmt.main(Compiled Code)
Any idea how to fix the problem?
Thanks
Long
-- Author: Nguyen, Long INET: Long.Nguyen_at_its.csiro.au Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-LReceived on Wed Aug 09 2000 - 15:55:46 CDT
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing). -- Author: Thomas L. Harleman INET: tharleman_at_iquest.net Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing). -- Author: INET: Val_Gamerman/Victoria_Financial.VICTORIA_FINANCIAL_at_lnn.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L