×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

how to use database connection

how to use database connection

how to use database connection

(OP)
Hi
In JDeveloper 9i you can create a database connection from New in the file menu. This connection is than shown in the System navigator. Does anyone know how to use this connection in the java code? What command or name do I have to type to use it?
Diederik

RE: how to use database connection

If your connection tested "Success" then you are on the right track
How would you do JDBC code?
Exactly like that.
You may want to use the connection pooling feaures(if yr driver supports it)
2 ways...the traditional:-
DriverManager.getconnection() per the  http://java.sun.com/docs/books/tutorial/jdbc/basics/index.html
See that the driver class library(one or many jar files) for the DB is added to the project settings library

OR
the more-nowadays-preferred-way(using the conn-pooling features of the driver)
First modify your datasources.xml in the <jdev9i install>/j2ee/home/config dir and add a <datasource> entry
Also will need to put the driver in the library(project settings)
And also need to modify application.xml with <library path> entries
This link below is for SQL Server..but you will get up to speed quick with whatever DB you are using
http://otn.oracle.com/products/jdev/howtos/bc4j/bc_psqlserverwalkthrough.html

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close