Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error in jdbc connection

 
bhagya raavi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am getting the following exception
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
i am using the following code in jsp
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection("jdbcracle:thin:@localhost:1521:xe", "scott", "tiger");
 
sangram mhatre
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please check , if the database is running and listener is running and the details you have provided in connection url are correct .
 
bhagya raavi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sangram mhatre:
Please check , if the database is running and listener is running and the details you have provided in connection url are correct .

thanku,sir
but all that are correct only
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by bhagya raavi:

thanku,sir
but all that are correct only


Baghya,
I doubt it.
Looks like you are using Oracle Express Edition (XE) database.
I don't think the SCOTT sample schema is installed on that database.
XE installs the HR sample schema.
Your database connection URL also looks incorrect and package "oracle.jdbc.driver" has been deprecated.
Now can you verify your claim that all the above is correct?
If you haven't already done so, I recommend reading the JDBC Developer's Guide and Reference which is part of the Oracle documentation and is available online.
Just google it.
You need the Oracle 10g documentation.

Good Luck,
Avi.
 
sangram mhatre
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you able to connect to the database xe with user name scott and password tiger externally using sqlplus ? Also can you provide your tnsnames entry ?
 
bhagya raavi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Avi Abrami:


Baghya,
I doubt it.
Looks like you are using Oracle Express Edition (XE) database.
I don't think the SCOTT sample schema is installed on that database.
XE installs the HR sample schema.
Your database connection URL also looks incorrect and package "oracle.jdbc.driver" has been deprecated.
Now can you verify your claim that all the above is correct?
If you haven't already done so, I recommend reading the JDBC Developer's Guide and Reference which is part of the Oracle documentation and is available online.
Just google it.
You need the Oracle 10g documentation.

Good Luck,
Avi.

thankyou for yoursugession
how to verify that those are correct
 
sangram mhatre
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you able to connect to the database xe with user name scott and password tiger externally using sqlplus ? Also can you provide your tnsnames entry ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic