• 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
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

error in jdbc connection

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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("jdbc:oracle:thin:@localhost:1521:xe", "scott", "tiger");
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic