Hi Madhuka,

On Tue, Jul 24, 2012 at 11:47 PM, Madhuka Udantha <[email protected]> wrote:

> hi,
>
> This is regarding org.jaggeryjs.hostobjects.db.DatabaseHostObject. We need
> a better way to slove jaggery-jira280 [1]. To achieve this we need some
> information on ndatasource.
> DatabaseHostObject have been used
> 'org.wso2.carbon.ndatasource.rdbms.RDBMSDataSource'.
>
> is there way check *that RDBMSDataSource is existing* from
> RDBMSDataSource?
>
> We found a method to getDataSource(String *dsName*) passing name in
> NDataSourceAdminService.
> (Think this dsName is unique?)
> Currently planing is to get DataSource from RDBMSDataSource. Then call
> getDataSource() from that DataSource
>

As I understood you are creating a datasource using
org.wso2.carbon.ndatasource.rdbms.RDBMSDataSource where datasource will be
created locally and will not be registered anywhere. This API is for
creating datasource objects to create connections. When we call
getDataSource() in RDBMSDataSource class it will return the existing
datasource object if it has already created. If not new datasource object
will be created and will be returned.

NDataSourceAdminService allows us to register datasources globally in the
registry. So if we are creating datasources using that way, we can check
whether that datasource exists using getDataSource(String *dsName*) method.

Thanks,
Lakmali


> If there is much easy way or standard way to achieve it, let me know.
>
> [1]  https://wso2.org/jira/browse/JAGGERY-280
> [2]
> https://svn.wso2.org/repos/wso2/carbon/platform/trunk/products/jaggery/components/hostobjects/org.jaggeryjs.hostobjects.db/src/main/java/org/jaggeryjs/hostobjects/db/DatabaseHostObject.java
>
>
> Thank you.
>
> --
> *Madhuka* Udantha
> http://madhukaudantha.blogspot.com/
>
>


-- 
Lakmali Baminiwatta*
*
Software Engineer
WSO2, Inc.: http://wso2.com
lean.enterprise.middleware
mobile:  +94 71 2335936
*
*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to