This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes Cam i set catalog on connection with oracle Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Cam i set catalog on connection with oracle" Watch "Cam i set catalog on connection with oracle" New topic
Author

Cam i set catalog on connection with oracle

avihai marchiano
Ranch Hand

Joined: Jan 10, 2007
Posts: 342
Hey,

lets say i have a connection that i get from data source.

The connection is to user XXX.

can i change the user in run time?

In my sql i point the data source to localhost:3306 and set the schema (catalog) in run time, can i do something like this in oracle?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26193
    
  66

Avihai,
No. The connection is tied to a specific user. To change user, you need to get a new connection.

This is similar to how you have to reconnect to login with a different user id at the sql plus command line.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Cam i set catalog on connection with oracle
 
Similar Threads
New to WebSphere and need help
EJB connection pools vs. Individual Oracle logins
Obtain reference of database connection pool within EJB stateless bean for OC4J
Please help with DataSource problem
Creating connection pool and data source dynamically