| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle JDBC Connection crashes with setIncludeSynonyms = true
Hi. Here's code I tried, and I couldn't duplicate the problem:
Driver dr = new oracle.jdbc.OracleDriver();
Properties props = new Properties();
props.put("user", "joe");
...
c = dr.connect("jdbc:oracle:thin:@mybox:1521:MYSID", props);
System.out.println("GOT A PLAIN CON" );
System.out.println("The driver is " +
c.getMetaData().getDriverVersion() );
System.out.println("The DBMS is " +
c.getMetaData().getDatabaseProductVersion() );
Statement s = c.createStatement();
try{s.executeUpdate("drop table joe");} catch (Exception ignore)
{}
s.executeUpdate("create table joe(foo int, bar int)");
((oracle.jdbc.OracleConnection)c).setIncludeSynonyms(true);
DatabaseMetaData dbmd = c.getMetaData();
ResultSet r = dbmd.getColumns(null, "JOE", "JOE", "%");
while (r.next()) {
System.out.println("[Column name: "
+ r.getString(4)+ "] [Data type: "
+ r.getString(5)+ "] [Data type name: "
+ r.getString(5)+"]");
}
System.out.println("Went OK so far..." );
s.executeQuery("select 1 from dual");
System.out.println("DONE" );
GOT A PLAIN CON
The driver is 10.2.0.2.0
The DBMS is Oracle Database 10g Enterprise Edition Release 10.1.0.4.0
- Production
With the Partitioning, OLAP and Data Mining options
[Column name: FOO] [Data type: 3] [Data type name: 3]
[Column name: BAR] [Data type: 3] [Data type name: 3]
Went OK so far...
DONE
Joe Weinstein at BEA Systems
Received on Fri Feb 02 2007 - 12:22:18 CST
![]() |
![]() |