aspose file tools*
The moose likes JDBC and the fly likes JDBC help? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC help?" Watch "JDBC help?" New topic
Author

JDBC help?

Alan Hermin
Ranch Hand

Joined: Feb 16, 2006
Posts: 290
hi ranchers...
iam using JDeveloper10g,and this is the code iam using to retrieve connection to database ,and this is the some information:
database: oracle database
userName and password for the database :test/test
the database located at remote machine and has this IP address: 10.0.0l.200
SID : ORCL
JDBC port : 1521



but i can NOT gain the connection..
can you help me?


[ November 01, 2006: Message edited by: Ala'a Hendi ]
[ November 01, 2006: Message edited by: Bear Bibeault ]
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

  • Did you create a DataSource named orcl ?
  • Is your code running inside container, becuase you can not get connection from Datasource our of your container


  • Shailesh


    Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
    Alan Hermin
    Ranch Hand

    Joined: Feb 16, 2006
    Posts: 290
    Hi Shailesh Chandra..
    iam using JDeveloper 10g IDE...i think JDeveloper 10g use OC4J..
    Shailesh Chandra
    Ranch Hand

    Joined: Aug 13, 2004
    Posts: 1081

    Do you get any exception ?
    Alan Hermin
    Ranch Hand

    Joined: Feb 16, 2006
    Posts: 290
    yes i got this ugly exception:
    Shailesh Chandra
    Ranch Hand

    Joined: Aug 13, 2004
    Posts: 1081

    Originally posted by Ala'a Hendi:
    yes i got this ugly exception:
    Could not locate datasource! Reason:
    javax.naming.CommunicationException: Connection refused: connect [Root


    Your problem is with DataSource only. As error states

    Could not locate datasource!


    I think you didn't create a datasource.

    hope this URL will help

    http://www.oracle.com/technology/products/jdev/howtos/10g/usingdatasources/using_datasources.html


    Shailesh
    Alan Hermin
    Ranch Hand

    Joined: Feb 16, 2006
    Posts: 290
    thank you .......
     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: JDBC help?