Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle JDBC Connection crashes with setIncludeSynonyms = true
joeNOSPAM_at_BEA.com wrote:
> 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
>
Hello Joe,
I executed your code to my database and I don't get problems with the newly created table (joe) but when accessing the old tables (created by the vendor) I still get problems.
After my DBA have created an synonym, such as create synonym dcsdba.irc for dcsdba.INTERFACE_RECEIPT_CONFIRM;" I could get the metadata but since the problem doesn't exists for the table JOE I think that something else is the real problem and it would be better to fix that instead of creating synonyms for each table.
I have not yet been able to get where the "real" problem is....do you have any thoughts?
-- // 4 IntegrationReceived on Mon Feb 05 2007 - 10:06:52 CST
![]() |
![]() |