• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data Source

 
priya shankar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI all
I have 5 Tables in Oracle 8i...Huv to bind a datasource name to all these tables...
Where to register the data source name , i am using Tomcat 3.2..
Can anybody give an example for all 4 types of Drivers when the database is Oracle..
What type conncetion(Class.forname()..or ctx.lookup("datasource name")) is good ...
expecting response from all u
priya
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 5 Tables in Oracle 8i...Huv to bind a datasource name to all these tables...

You don't bind datasources to individual tables; you bind datasources to database schemas.
Where to register the data source name , i am using Tomcat 3.2..

I don't think Tomcat 3.2 supports this type of datasource configuration. You might want to get a second opinion on that, however.
What type conncetion(Class.forname()..or ctx.lookup("datasource name")) is good ...

Using a datasource is always preferable over Class.forName(...) + DriverManager.getConnection(...).
 
priya shankar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lasse
----------------------------------------------------------------------------
You don't bind datasources to individual tables; you bind datasources to database schemas.
----------------------------------------------------------------------------
Huv to Do this Lasse.
----------------------------------------------------------------------------
I don't think Tomcat 3.2 supports this type of datasource configuration. You might want to get a second opinion on that, however.
----------------------------------------------------------------------------
Huv to Do this Lasse.

Thanks
priya
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is 'huv'?
 
Pearlo Muthukumaran
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Priya,
I am interested too in knowing what is 'huv'. I believe its a contraint imposed on your assignment.
One way of conning is as follows:
1. Create a sesparate database user - Consult your Oracle DBA for this
2. Assign privileges on the '5 tables' to this new user
3. Use this new user's username and password in configuring the datasource
at server.xml config file of Tomcat.

Now you have what you want. Btw, use ctx.lookup("PriyaDatasource").....
that gives you benefit of connection pooling.....
As Lasse rightly pointed out, there cannot be a Datasource binding for a set tables.Instead a Datasource can be only bound to Database Schema. What I have suggested is a way of achieveing what you wanted.Thats it.In the above solution also you bind Datasource to a Schema but username and password combination restricts you to only those '5 tables' and it appears like a pseudo-table-bound-datasource (PTBD - ha !!! one more acronym!!!).
Hope this helps....
Cheers
Pearlo
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess it is how

Originally posted by David O'Meara:
What is 'huv'?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic