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 -> newbie: query a table from java

newbie: query a table from java

From: Frank Ratzlow <frank_ratzlow_at_hotmail.com>
Date: 24 Feb 2003 16:39:06 -0800
Message-ID: <5ef29569.0302241639.dfb42a6@posting.google.com>


Hi,

one basically simple thing. I'd like to work with the example tables given provided with the standard setup within a java prog.

When issuing the example from a book:



Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@sunsrv01:1521:fr1", "scott", "tiger");
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("SELECT ename FROM emp");

======================================

I get a proper result but when I want to query the table "HR"."JOBS" ResultSet rset = stmt.executeQuery("SELECT * FROM hr.jobs");

I always receive

<java.sql.SQLException: ORA-00942: table or view does not exist>

How do I have to format the statement to specify the schema it belongs to? At the first glance it seemed to be "HR"."JOBS" but even this with and without quoting didn't solved it.

Would be very grateful to get a hint how to touch tables in different schemas from JAVA.

TIA Frank
frank_ratzlow_at_nojunk.hotmail.com Received on Mon Feb 24 2003 - 18:39:06 CST

Original text of this message

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