You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Charles-Alexandre Sabourdin <ka...@dedaletechnology.com> on 2003/12/18 09:57:28 UTC

DB2 datasource

Probleme with datasource and maybe SQL:

Hello, I have the following problems :
Basically I use two different users 1 for administating (user=db2adm) and one 
only has a reader (user=user). 

note :
SELECT * FROM Table1 => 
Error: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/LINUX] SQL0204N Le 
nom "USER.TABLE1" n'est pas défini.  SQLSTATE=42704

while 
SELECT * FROM DB2ADM.Table1 => Works correctly
Here are my Torque.properties

--
torque.applicationRoot=/home/kaneda/java/tomcat
# Sets the driver for the data sources.
torque.defaults.connection.driver=COM.ibm.db2.jdbc.net.DB2Driver

# Sets the URL for the datasources
torque.defaults.connection.url=jdbc:db2://192.168.1.9:6789/TESTUSED

# Sets login and password for the data sources.
torque.defaults.connection.user=user
torque.defaults.connection.password=***

torque.database.TESTUSED.adapter=db2net

## Using commons-dbcp
torque.dsfactory.TESTUSED.factory=org.apache.torque.dsfactory.SharedPoolDataSourceFactory
torque.dsfactory.TESTUSED.connection.driver=COM.ibm.db2.jdbc.net.DB2Driver
torque.dsfactory.TESTUSED.connection.url=jdbc:db2://192.168.1.9:6789/TESTUSED
# This works correctly
#torque.dsfactory.TESTUSED.connection.user=db2adm
#torque.dsfactory.TESTUSED.connection.password=*****
torque.dsfactory.TESTUSED.connection.user=user
torque.dsfactory.TESTUSED.connection.password=*****



-- 
Charles-Alexandre
SABOURDIN
-----------------


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: DB2 datasource

Posted by Michael Della Bitta <md...@columbia.edu>.
i think the problem is that DB2 assumes the schema = the username if  
none is provided in the sql. so you're creating all your tables under  
schema DB2ADM, and trying to access them as if they were in schema  
USER.

i'm unaware of the support for database schemas in Torque. i seem to  
remember someone working on some patches for that, but deciding against  
using them because it would fork from the main source.

is there anyone more informed than i am that wants to chime in?

michael


On Dec 18, 2003, at 3:57 AM, Charles-Alexandre Sabourdin wrote:

> Probleme with datasource and maybe SQL:
>
> Hello, I have the following problems :
> Basically I use two different users 1 for administating (user=db2adm)  
> and one
> only has a reader (user=user).
>
> note :
> SELECT * FROM Table1 =>
> Error: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/LINUX]  
> SQL0204N Le
> nom "USER.TABLE1" n'est pas défini.  SQLSTATE=42704
>
> while
> SELECT * FROM DB2ADM.Table1 => Works correctly
> Here are my Torque.properties
>
> --
> torque.applicationRoot=/home/kaneda/java/tomcat
> # Sets the driver for the data sources.
> torque.defaults.connection.driver=COM.ibm.db2.jdbc.net.DB2Driver
>
> # Sets the URL for the datasources
> torque.defaults.connection.url=jdbc:db2://192.168.1.9:6789/TESTUSED
>
> # Sets login and password for the data sources.
> torque.defaults.connection.user=user
> torque.defaults.connection.password=***
>
> torque.database.TESTUSED.adapter=db2net
>
> ## Using commons-dbcp
> torque.dsfactory.TESTUSED.factory=org.apache.torque.dsfactory.SharedPoo 
> lDataSourceFactory
> torque.dsfactory.TESTUSED.connection.driver=COM.ibm.db2.jdbc.net.DB2Dri 
> ver
> torque.dsfactory.TESTUSED.connection.url=jdbc:db2://192.168.1.9:6789/ 
> TESTUSED
> # This works correctly
> #torque.dsfactory.TESTUSED.connection.user=db2adm
> #torque.dsfactory.TESTUSED.connection.password=*****
> torque.dsfactory.TESTUSED.connection.user=user
> torque.dsfactory.TESTUSED.connection.password=*****
>
>
>
> -- 
> Charles-Alexandre
> SABOURDIN
> -----------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Fwd: RE: Schema name in DB2

Posted by Charles-Alexandre Sabourdin <ka...@dedaletechnology.com>.
Hello I look around for JSSU user and I did not find any information neither 
on google or from torque 'CVS'

So what should I do in order to use this "JSSU" user ?

work into the CVS does not affraid me but before digging I would rather know 
where and what to look for.




I finally got the schema name prefix working with small changes in
BasePeer.java and Criteria.java
But, I think we want to create a user JSSU and use it rather than using the
changed code, to be able to easily upgrade the version.

Thanks for your response.
Prashanth


-----Original Message-----
From: Giulio Vezzelli [mailto:giulio.vezzelli@infolog.it]
Sent: Friday, November 21, 2003 5:16 PM
To: Apache Torque Users List
Subject: R: Schema name in DB2


I had schema problems too, with DB2 and Torque.

I used this dirty workaround : DB2 tries to use the database user name you
supplied as the schema name, if not specified.

So, if you create and use a "JSSU" user for connecting to DB2, you'll handle
it. I know it's not the "good" solution, but it kinda works.

-- 
Charles-Alexandre
SABOURDIN
-----------------


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org