This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes i am using orcale, mysql databases , if i use context.xml i can get datasource for only one db Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "i am using orcale, mysql databases , if i use context.xml i can get datasource for only one db" Watch "i am using orcale, mysql databases , if i use context.xml i can get datasource for only one db" New topic
Author

i am using orcale, mysql databases , if i use context.xml i can get datasource for only one db

rk palleru
Greenhorn

Joined: Feb 26, 2009
Posts: 22
please help me

i am using orcale, mysql databases for two different web applications , i am executing both applications simultaneously if i specify in context.xml ,i can get datasource object only for one db(either oracle or mysql).
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

Can you tell why don't you want to do a lookup. When you declare a datasource using context.xml in apache tomcat, then it is added as a JNDI resource. I don't think you can retrieve it using anything other than lookup...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41124
    
  45
The whole point of DataSource is to be used through JNDI. If you're set on not using JNDI (why?) you might just as well use DriverManager.


Ping & DNS - my free Android networking tools app
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874


how to get datasource object in tomcat without using jndi for oracle/mysql


Well for Oracle, you can use Class oracle.jdbc.pool.OracleDataSource and OracleXADataSource can be used.
1) create object of OracleDatasource
2) set the connection parameters (DB details) and get connection.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: i am using orcale, mysql databases , if i use context.xml i can get datasource for only one db
 
Similar Threads
Jboss and mysql connection (failover)
Legacy Data Store
i am using orcale, mysql databases , if i use context.xml i can get datasource only for one db
Context Question
How to use configured datasource