J2EE with Oracle DB

i'm a beginner of J2EE.

If i want to build a project with J2EE and Oracle.

How could i set up the connection to oracle in J2EE ?

I was seeing the j2ee tutorial provided by java.sun.com. but it dose not mention how to connect to oracle DB in the deploytool.

Thanks for your helping

[312 byte] By [yundi] at [2007-9-27 18:22:19]
# 1

I believe you are using sun's reference implementation of J2EE. If you are using the j2sdkee1.2.1 , then there is a properties file (config/default.properties) under the J2EE installation directory. For higher versions of j2sdkee , it has been moved to some other properties file I think. But you can figure it out if you search the config directory. There you can declare your own datasource and provide it's URL and driver.

You can bind a jndi name to the datasource through your deployment descriptor. From your EJB , you can access the datasource by doing a jndi lookup.

Best Regards,

Ashoke Bhowmick

ashoktaru at 2007-7-6 18:53:41 > top of Java-index,Other Topics,Patterns & OO Design...
# 2

If you want to getting started with J2EE & Oracle, do the following two steps:

1. Connect through ODBC drivers (Microsoft drivers for Oracle from User DSN / System DSN) using sun.jdbc.odbc.JdbcOdbcDriver or Use proprietary drivers like thin driver.

2. Use JDBC logic in your presentation layer (JSP/Servlets,etc.) or business layer (EJB).

Best Regards

M.S. Mansoor

m_s_mansoor at 2007-7-6 18:53:41 > top of Java-index,Other Topics,Patterns & OO Design...
# 3

Try this instruction: http://java.sun.com/j2ee/sdk_1.3/1.3_01/techdocs/release/ConfigGuide.html

1. The oracle jdbc driver (classes111.zip) is located in the c:\oracle\ora81\jdbc\lib directory. Just copy it over to your J2EE_HOME/lib/system directory.

2. Open the resource.properties file in the c:\j2sdkee1.3.1\config directory and enter your driver information.

- nick

nickhung at 2007-7-6 18:53:41 > top of Java-index,Other Topics,Patterns & OO Design...
# 4
use jdbc
richardluopeng at 2007-7-6 18:53:41 > top of Java-index,Other Topics,Patterns & OO Design...
# 5
datasource
richardluopeng at 2007-7-6 18:53:41 > top of Java-index,Other Topics,Patterns & OO Design...