Hello,
I am new w/ Orion and I have the following problem:
I can't connect however it seems to be connected
but when I want to call some method from Connection class
(like con.getMetaData or con.createStatement) I just get
exception: java.sql.SQLException: Io exception: The Network Adapter
could not establish the connection
When I check listener log file,
there is of course no record about getting connection.
I have Oracle8.0.6, jdk1.2.2, orion1.3.8
My data-source.xml looks like:
<data-source
class="com.evermind.sql.ConnectionDataSource"
name="Oracle"
location="jdbc/OracleDS"
xa-location="jdbc/xa/OracleXADS"
ejb-location="jdbc/OracleDS"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="scott"
password="tiger"
url="jdbc:oracle:thin:scott/tiger@localhost:1512:pc29"
inactivity-timeout="30"
schema="database-schemas/oracle.xml"
/>
web.xml looks like:
<context-param>
<param-name>OracleDS</param-name>
<param-value>jdbc/OracleDS</param-value>
</context-param>
<resource-ref>
<description>Test Data Source</description>
<res-ref-name>OracleDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Application</res-auth>
</resource-ref>
and EJB code:
final private String dbName = "jdbc/OracleDS";
String s = "";
/********** THIS PART WORK FINE, BUT IT DOESN'T MAKE CONNECTION AT ALL
***/
InitialContext ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup(dbName);
Connection con = ds.getConnection();
s = "Conected";
if ( con.isClosed() )
s += "Closed";
else
s += "NOT Closed";
/**************** THIS PART DOESN'T WORK !!! *******************
DatabaseMetaData dm = con.getMetaData();
s += dm.getDriverVersion();
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("SELECT ename FROM emp");
if ( rs.next() )
s += rs.getString("ename");
else
s += "Empty";
*/
con.close();
return s;
I really don't know what to do. I spent two days over that problem
and I am lost!!! Thank you VERY much for any advice.
<<<btw: I spend another day w/ java:comp/env/jdbc/OracleDS :(( >>>
Martin