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: Oracle JDBC Connection crashes with setIncludeSynonyms = true

Re: Oracle JDBC Connection crashes with setIncludeSynonyms = true

From: <joeNOSPAM_at_BEA.com>
Date: 5 Feb 2007 08:20:56 -0800
Message-ID: <1170692456.576238.298590@m58g2000cwm.googlegroups.com>


On Feb 5, 8:06 am, 4 Integration <4integrat..._at_gmail.com> wrote:
> joeNOS..._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 Integration

I would have the dba examine the system catalogs for the metadata describing the
old tables, and investigate the difference between how the DBMS describes an
old table, and a new one such as 'JOE'. In fact, make JOE have exactly the
same DDL as the old table you're having trouble with, just for fun... At this
point I believe the driver is innocent in this regard, and that it is reporting
whatever the DBMS sends it (or doesn't send it). Joe Weinstein at BEA Systems Received on Mon Feb 05 2007 - 10:20:56 CST

Original text of this message

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