db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Hauf...@hauf.org>
Subject Re: GetConnection
Date Mon, 11 Sep 2006 13:43:23 GMT
Hello,

thank you for your help. It seems that I have found a solution that 
works for my problem with the Postgis-geometry-datatype.
The solution was quite simple: I patched the 
com.workingdogs.village.Value-class and can now get access to the 
underlying object of each value in my records.

But I still have a small question: The datatype of my postgis-geometry 
is Types.OTHER and this datatype is returned as String from the 
om.workingdogs.village.Value-class. Is there any possibility to access 
the underlying objets of a record without patching the value class?
I tried with the dataset()-method in the Result-class, but the recordSet 
is always empty.

John






Greg Monroe wrote:
> Hmm, did some code spelunking and found that the accessTo...
> parameter in dbcp only works for BasicDataSources.  Torque's 
> SharedPoolDataSourceFactory uses DBCP's SharedPoolDataSource
> which does not support this option.  So the class of connection 
> object you get will be: 
> 
>   org.apache.commons.dbcp.cpdsadapter.ConnectionImpl
> 
> and this doesn't allow access to the real connection.
> 
> That said, one thing to try is subclassing the PostGres JDBC
> Driver class and overriding the connect method to add your
> 'geometries' type.  Then use this subclass in your Torque
> settings.
> 
> 
>> Johannes Hauf said:
>>
>> Thank you. I tried with your suggestion and I think this 
>> would work if the database wouldn't be Postgres.
>> In the postgres-jdbc driver, the typeMap-mechanism seems not 
>> to be implemented yet.
>>
>> Has anyone another idea?
>>
>> John
>>
>> Greg Monroe wrote:
>>> Can you use the standard Connection interface TypeMap support to do 
>>> the same thing rather than the PostGres extension?  E.g.
>>>
>>> Map map = conn.getTypeMap();
>>> map.put("geometry", Pggeometry.class); conn.setTypeMap(map);
>>>
> 
> Duke CE Privacy Statement
> Please be advised that this e-mail and any files transmitted with it are confidential
communication or may otherwise be privileged or confidential and are intended solely for the
individual or entity to whom they are addressed.  If you are not the intended recipient you
may not rely on the contents of this email or any attachments, and we ask that you  please
not read, copy or retransmit this communication, but reply to the sender and destroy the email,
its contents, and all copies thereof immediately.  Any unauthorized dissemination, distribution
or copying of this communication is strictly prohibited.
> 
> 
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message