Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specify default schema for JDBC pool in weblogic/oracle

We use the same user for multiple projects and I want to have a different default schema for different connection pools. Is there a way to specify the default schema in the weblogic JDBC configuration?

like image 583
Roman Goyenko Avatar asked Apr 17 '13 16:04

Roman Goyenko


People also ask

What is JDBC connection pool in WebLogic?

A connection pool is a named group of identical JDBC connections to a database that are created when the connection pool is deployed, either at WebLogic Server startup or dynamically during run time. Your application "borrows" a connection from the pool, uses it, then returns it to the pool by closing it.

What is JDBC schema?

Schema is a logical namespace that contains database objects such as tables, views, indexes, etc. Each schema belongs to one database, and each database has at least one schema. If not specified otherwise, the default schema in PostgreSQL is public.


1 Answers

Ok, I figured it out myself:

If you go to Data Source-> Configuration -> Connection Pool -> click Advanced,

There is Init SQL there that will be executed for initialization of newly created physical db connection, we can put:

SQL ALTER SESSION SET CURRENT_SCHEMA=animals

to make the default schema.

like image 189
Roman Goyenko Avatar answered Oct 24 '22 10:10

Roman Goyenko