You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by idan <id...@gmail.com> on 2010/10/26 15:46:47 UTC

JDBC Properties

Hey,

Is it possible to pass extra connection properties to the JDBC driver?
I'm currently using my own JDBC driver which has some custom properties and
can't find a way to pass these properties from "persistence.xml".

Thanks,
Idan

-- 
View this message in context: http://openjpa.208410.n2.nabble.com/JDBC-Properties-tp5674653p5674653.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: JDBC Properties

Posted by Kevin Sutter <kw...@gmail.com>.
Hmmm...  Probably depends on the Driver being used and what properties are
attempted to be set (ie. are they valid properties?)...

I just tried the following and this works for the DB2Driver...

            <property name="openjpa.ConnectionDriverName"
value="com.ibm.db2.jcc.DB2Driver"/>
            <property name="openjpa.ConnectionProperties"
value="username=sutter, password=xxxxxx"/>
            <property name="openjpa.ConnectionURL"
value="jdbc:db2://localhost:50000/TEST"/>

I've verified this is working via TRACE and monitoring the results of my
test.  If I don't use the ConnectionProperties, then I can't get a
connection due to invalid or insufficient credentials.  Of course, the
username and password could have been specified on the URL, or via the
ConnectionUsername and ConnectionPassword properties.

Kevin

On Wed, Oct 27, 2010 at 3:16 AM, idan <id...@gmail.com> wrote:

>
> Hey thanks for the help.
>
> I specified my property in openjpa.ConnectionProperties and it didnt work.
> When using DBCP i added my property to DBCP's connectionProperties and that
> worked.
>
> I'm probably doing something wrong with openjpa.ConnectionProperties.
>
> Is there any special format for this property?
>
>
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/JDBC-Properties-tp5674653p5677672.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Re: JDBC Properties

Posted by idan <id...@gmail.com>.
Hey thanks for the help.

I specified my property in openjpa.ConnectionProperties and it didnt work.
When using DBCP i added my property to DBCP's connectionProperties and that
worked.

I'm probably doing something wrong with openjpa.ConnectionProperties.

Is there any special format for this property?




-- 
View this message in context: http://openjpa.208410.n2.nabble.com/JDBC-Properties-tp5674653p5677672.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: JDBC Properties

Posted by Kevin Sutter <kw...@gmail.com>.
Try this reference [1].  It sounds like either specifying the properties on
the URL or using the openjpa.ConnectionProperties property is what you are
looking for.

[1]
http://openjpa.apache.org/builds/2.0.1/apache-openjpa-2.0.1/docs/manual/manual.html#ref_guide_dbsetup_builtin

On Tue, Oct 26, 2010 at 9:13 AM, C N Davies <cn...@cndavies.com> wrote:

> Did you check javadoc  OpenJPAConfigurationImpl ?
>
> Chris
>
> -----Original Message-----
> From: idan [mailto:idanmo@gmail.com]
> Sent: Wednesday, 27 October 2010 12:47 AM
> To: users@openjpa.apache.org
> Subject: JDBC Properties
>
>
> Hey,
>
> Is it possible to pass extra connection properties to the JDBC driver?
> I'm currently using my own JDBC driver which has some custom properties and
> can't find a way to pass these properties from "persistence.xml".
>
> Thanks,
> Idan
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/JDBC-Properties-tp5674653p5674653.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>
>

RE: JDBC Properties

Posted by C N Davies <cn...@cndavies.com>.
Did you check javadoc  OpenJPAConfigurationImpl ?

Chris

-----Original Message-----
From: idan [mailto:idanmo@gmail.com] 
Sent: Wednesday, 27 October 2010 12:47 AM
To: users@openjpa.apache.org
Subject: JDBC Properties


Hey,

Is it possible to pass extra connection properties to the JDBC driver?
I'm currently using my own JDBC driver which has some custom properties and
can't find a way to pass these properties from "persistence.xml".

Thanks,
Idan

--
View this message in context:
http://openjpa.208410.n2.nabble.com/JDBC-Properties-tp5674653p5674653.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.