• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

OracleDatasource with Eclipse

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am getting this stacktrace while conecting my java to oracle. I am using eclipse 3.3, oracle9i and java1.5.

the stacktrace is as follows:

java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3668)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:353)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:371)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:551)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:351)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:169)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:105)
at web.persistent.ConMgmt.getConnection(ConMgmt.java:21)
at web.persistent.TestConnection.main(TestConnection.java:21)
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820]


also while debuging the program it is stucking to a line where i say
ds = new OracleDataSource(); // it is sayig source not found while comming to this line.

SOurce Code:

public class ConMgmt
{
private static OracleDataSource ds;
public static Connection getConnection() throws SQLException
{
if(ds==null)
{
ds=new OracleDataSource();
ds.setUser("scott");
ds.setPassword("tiger");
ds.setURL("jdbc:oracle:thin:@localhost:1521:oradb");
System.out.println(ds.getLoginTimeout());
}
return ds.getConnection();
}
 
piyush kumar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by piyush kumar:
Hi all,

I am getting this stacktrace while conecting my java to oracle. I am using eclipse 3.3, oracle9i and java1.5.

the stacktrace is as follows:

java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3668)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:353)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:371)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:551)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:351)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:169)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:105)
at web.persistent.ConMgmt.getConnection(ConMgmt.java:21)
at web.persistent.TestConnection.main(TestConnection.java:21)
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820]


also while debuging the program it is stucking to a line where i say
ds = new OracleDataSource(); // it is sayig source not found while comming to this line.

SOurce Code:

public class ConMgmt
{
private static OracleDataSource ds;
public static Connection getConnection() throws SQLException
{
if(ds==null)
{
ds=new OracleDataSource();
ds.setUser("scott");
ds.setPassword("tiger");
ds.setURL("jdbc:oracle:thin:@localhost:1521:oradb");
System.out.println(ds.getLoginTimeout());
}
return ds.getConnection();
}



Hello all

My above problem is solved by some cofiguration settings for oracle. I started "lsnrctl.exe" file from oracle home and the problem got resolved as the exe file was on the stopped status in the services. But now a new problem is coming this "lsnrctl.exe" is using port 8080 for some of its listening endpoints so while this is running my application server JBoss cannot run. Can anybody please let me know if i can change the port of JBoss server and How? or else any other solutionto this problem.

Thanks in advance
piyush
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic