Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: JDBC: select statements causing errros when using classes12.zip but not when using classess111.zip

Re: JDBC: select statements causing errros when using classes12.zip but not when using classess111.zip

From: C. Ferguson <c_ferguson_at_rationalconcepts.com>
Date: Wed, 04 Aug 1999 00:18:21 -0700
Message-ID: <37A7E93D.1497109F@rationalconcepts.com>


By chance, does the table select return things other than strings? Say, an Integer?

This is where the error might be occurring:
>> result += rs.getString(i) + " ";

In your exception handler, put e.printStackTrace(); This will show you the exact line it's dumping at.

If you can't get a line number from the stacktrace, use this: java -Djava.compiler=NONE -classpath... yourApp The -D option is telling java to not use the jit compiler, which tends to write (compiled code) instead of line number
in the stack trace.

Hope this is on the right track and gives you enough clues. Cindy

Josh Gough wrote:

> Cindy,
> Thank you for responding. The code I used is below. I just ran it again,
> and sure enough it runs great with 111.zip, but gives me:
>
> "ORA-03120: two-task conversion routine: integer overflow"
>
> With 12.zip
>
> Oddly, if i pass "select some_single_col_name from node" that works in
> either...weird.
>
> Any suggestions?
>
> Thanks!
>
> -Josh Gough
>
> -------------------------------------------------------------------
> import java.sql.*;
>
> public class SampleQuery {
> public static void main(String args[]) {
> try {
> Class.forName("oracle.jdbc.driver.OracleDriver");
> String url = "jdbc:oracle:thin:@(description=(address=(host=
> localhost)(protocol=tcp)(port=1521))(connect_data=(sid=hrd)))";
> Connection con = DriverManager.getConnection(url, "blah",
> "blahxxxxxx");
> Statement stmt = con.createStatement();
> String sql;
> if (args.length > 0)
> sql = args[0];
> else
> sql = "SELECT * from node";
> String result="";
> System.out.println("The query: " + sql + "\n");
> // run query
> ResultSet rs = stmt.executeQuery(sql);
> ResultSetMetaData rsmd = rs.getMetaData();
> int col_count = rsmd.getColumnCount();
> System.out.println("Columns: " + String.valueOf(col_count));
> while(rs.next()) {
> for (int i=1; i <= col_count; i++) {
> result += rs.getString(i) + " ";
> }
> System.out.println(result + "\n");
> result = "";
> }
> rs.close();
> stmt.close();
> } catch (Exception e) {
> System.out.println(e.getMessage());
> }
> }
> }
> -------------------------------------------------------------------
>
> "C. Ferguson" wrote:
>
> > Hi Josh,
> > Could you post your code snippet? I've used both the classes111 and
> > classes12 files, with no code modifications and they work fine. I do lots
> > of multi column selects...
> > Cindy
> >
Received on Wed Aug 04 1999 - 02:18:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US