Getting Connection object in bsh or java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting Connection object in bsh or java

nashrul
How can I get the Connection object in bsh script or java ?? I use oracle database 10g and want to do some queries. I try to use  this one:
 
TransactionFactoryInterface tfi = TransactionFactory.getTransactionFactory();
Connection conn = tfi.getConnection("jdbc:oracle:thin@167.34.22.50:1521:orcl");  
                                                              // @machineName:port:SID

The signature for getConnection method is:
public static Connection getConnection(String helperName) throws SQLException, GenericEntityException {
        return getTransactionFactory().getConnection(helperName);
    }

I don't know what the argument (String helperName) means (what i should put in this argument).... Is the argument i put above correct ?? Could someone give me an insight ??
Reply | Threaded
Open this post in threaded view
|

Re: Getting Connection object in bsh or java

Gautam Deb-2
Please go through the entityengine.xml (ofbiz.home
/framework/entity/config/).

Also this document will be helpful
http://ofbiz.apache.org/docs/entity.html#The_Entity_Engine_API

Regards,
Gautam Deb



On 8/10/07, nashrul <[hidden email]> wrote:

>
>
> How can I get the Connection object in bsh script or java ?? I use oracle
> database 10g and want to do some queries. I try to use  this one:
>
> TransactionFactoryInterface tfi =
> TransactionFactory.getTransactionFactory();
> Connection conn =
> tfi.getConnection("jdbc:oracle:thin@167.34.22.50:1521:orcl");
>                                                               //
> @machineName:port:SID
>
> The signature for getConnection method is:
> public static Connection getConnection(String helperName) throws
> SQLException, GenericEntityException {
>         return getTransactionFactory().getConnection(helperName);
>     }
>
> I don't know what the argument (String helperName) means (what i should
> put
> in this argument).... Is the argument i put above correct ?? Could someone
> give me an insight ??
> --
> View this message in context:
> http://www.nabble.com/Getting-Connection-object-in-bsh-or-java-tf4247973.html#a12089168
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Getting Connection object in bsh or java

Rodrigo Lima-2
Get default helperName.

Connection conn = tfi.getConnection("default");



2007/8/10, Gautam Deb <[hidden email]>:

>
> Please go through the entityengine.xml (ofbiz.home
> /framework/entity/config/).
>
> Also this document will be helpful
> http://ofbiz.apache.org/docs/entity.html#The_Entity_Engine_API
>
> Regards,
> Gautam Deb
>
>
>
> On 8/10/07, nashrul <[hidden email]> wrote:
> >
> >
> > How can I get the Connection object in bsh script or java ?? I use
> oracle
> > database 10g and want to do some queries. I try to use  this one:
> >
> > TransactionFactoryInterface tfi =
> > TransactionFactory.getTransactionFactory();
> > Connection conn =
> > tfi.getConnection("jdbc:oracle:thin@167.34.22.50:1521:orcl");
> >                                                               //
> > @machineName:port:SID
> >
> > The signature for getConnection method is:
> > public static Connection getConnection(String helperName) throws
> > SQLException, GenericEntityException {
> >         return getTransactionFactory().getConnection(helperName);
> >     }
> >
> > I don't know what the argument (String helperName) means (what i should
> > put
> > in this argument).... Is the argument i put above correct ?? Could
> someone
> > give me an insight ??
> > --
> > View this message in context:
> >
> http://www.nabble.com/Getting-Connection-object-in-bsh-or-java-tf4247973.html#a12089168
> > Sent from the OFBiz - User mailing list archive at Nabble.com.
> >
> >
>