Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to use database connection

Status
Not open for further replies.

dwentink

Programmer
Apr 5, 2002
11
NL
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
 
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 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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top