How to create datasource object ..?

Can any one tell how to create database connection using Datasource object... ? If possible giveing exapomle/code for it.. to connect my applicatin with oracle... ? thanks...
[188 byte] By [Shebua] at [2007-11-27 9:50:04]
# 1

Obtain a JDBC driver that uses connection pooling from the vendor. For example, go to Oracle home page and download ojdbc14.jar which is a JDBC for Oracle 10g database. copy it to your lib folder in your project and add it to your classpath for that project.

If your using tomcat server, add a datasource tag to its server.xml file. You'll need to read up on how to do this. The datasource tag will look for an object in ojdbc14.jar file for an object that implements the datasource interface. If you dont want to get the datasource from tomcat, you can implement your own connection pool object directly in your project and obtain the connection from that object.

Use Connection conn=dataSource.getConnection() to get a connection.

Use try/catch/finally block of code to properly get and close the connection. Sorry, cant go into any more details, its too long to do so.

George123a at 2007-7-13 0:18:39 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...