Hi,

I'm using "Hibernate" for my Application and i use "c3p0" for Create a Connection pool. Now i want to use these connection objects with relevant
Database user.
Ex:
DBMS Users : user1 -> Admin
user2 -> Manager

Now i want to execute curtain QUERIES with different users.
How can i do this.

This is my hibernate.cfg.xml file

<!DOCTYPE hibernate-configuration SYSTEM
"hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">
org.postgresql.Driver
</property>
<property name="hibernate.connection.url">
relevant uurl to database
</property>
<property name="hibernate.connection.username">
enterprisedb
</property>
<property name="hibernate.connection.password">
myroot
</property>
<property name="hibernate.dialect">
org.hibernate.dialect.PostgreSQLDialect
</property>
<property name="hibernate.jdbc.use_get_generated_keys">
false
</property>
<property name="hibernate.default_entity_mode">
pojo
</property>
<!-- Use the C3P0 connection pool provider -->
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.timeout">300</property>
<property name="hibernate.c3p0.max_statements">50</property>
<property name="hibernate.c3p0.idle_test_period">3000</property>
<!-- Show and print nice SQL on stdout -->
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>
<!-- List of XML mapping files -->
<mapping package="initial_customize"/>
<mapping class="initial_customize.CompanyUnit"/>
<mapping class="initial_customize.CompanyHoliday"/>
<mapping class="initial_customize.Currency"/>
<mapping class="initial_customize.Duty"/>
<mapping class="initial_customize.EmployeeGroupType"/>
<mapping class="initial_customize.Experience"/>
</session-factory>
</hibernate-configuration>


**** Now all the queries execute as "enterprisedb" which is Administrator.
but i want to access the Database using the Connection pool with limited access.

Is there any Configuration mechanism ?