You say you are using Oracle, but your configuration is for a MySQL database. For Oracle, your driver class is going to be oracle.jdbc.driver.OracleDriver. Your URL is going to follow this pattern:

jdbc:oracle:thin:@<hostname>:<port>:<db_name>

The "database name" is also known as a TNS name in Oracle terms. Usually this is something you have to obtain from whoever set up the database.

You are also going to need to download the Oracle thin driver from the URL I gave you earlier. You may have to register, I can't remember, but it's painless if you do.

The driver jar file (ojdbc14.jar) has to be in your server's classpath. You don't say what server you are using, but in the case of Tomcat, it goes in <tomcat_home>/common/lib/.

The Oracle thin driver (the collection of classes which lives in the above mentioned jar file) is a Java library which enables your Java application to talk to the Oracle database server over a network using the JDBC API. The classes are implementations of JDBC. (Sorry if you already know all this.)

You don't have to use the Struts data source configuration you are trying to use, but you can if you want. Consider it to be optional. It might be easier to just follow the documentation that comes with your server for setting up a JDBC connection pool (data source). You can get a reference to a Java DataSource instance using a standard JNDI lookup (there are tutorials on this). Again, if you are using Tomcat, the docs will help with this (I think there is an Oracle example).

Hope this helps,

Erik




Nishant wrote:

hello,
i am using oracle 9i as my database in my application.
My database is on anothere machine in network.
my struts-config.xml is like
<data-sources>
   <data-source type="org.apache.commons.dbcp.BasicDataSource">
     <set-property property="driverClassName"
       value="com.mysql.jdbc.Driver" />
     <set-property property="url"
       value="jdbc:mysql://localhost/employees" />
     <set-property property="username"
       value="thinc"/>
     <set-property property="password"
       value="thinc"/>
   </data-source>
 </data-sources>

now server is throwing an errors as cannot load JDBC driver called com.mysql.jdbc.Driver wht is wrong .... wiil i hav to import some external JDBC driver (on my pc no oracle is there )


Nishant Patil
Software Engineer
Cybage Software Pvt. Ltd. (A CMM Level 3 Company)
West Avenue , Kalyani Nagar,
Pune - 411 006
Tel: 91-20-4041700 -355
Email: [EMAIL PROTECTED]
Website: www.cybage.com
There's a difference between knowing the path, and walking the path



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to