Foren

Issue getting values from DB2.

Anil Kumar, geändert vor 11 Jahren.

Issue getting values from DB2.

New Member Beiträge: 14 Beitrittsdatum: 24.06.12 Neueste Beiträge
Hi All,

Using Service Builder to get the values from the labelName[column name] & table name is Search. I am accessing DB2 remotely.

When service builder is generated, its create a table as WBNC_Search. [WBNC is namespace]

service.xml

?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.0.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_0_0.dtd">
<service-builder package-path="com.srch.portlet">
<author>Raj</author>
<namespace>WBNC</namespace>

<entity name="Search" local-service="true" remote-service="true">

<!-- PK fields -->

<column name="sid" type="int" primary="true" />

<!-- Group instance -->

<column name="labelName" type="String" />
<column name="NSORTSEQ" type="float" />

</entity>

</service-builder>


As service builder is creating table with WBNC_Search, I wanted to change to WBNC.Search so that i can call from DB2 database.

Tried changing in portlet-hbm.xml file. Didnt work.

Appreicate your help in resolving this issue.

Thanks & Regards
Anil
thumbnail
David H Nebinger, geändert vor 11 Jahren.

RE: Issue getting values from DB2.

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
SB does not support catalog/schema in entities.

You need to define a separate connection to DB2 that uses the "WBNC" as the default for tables.
thumbnail
Vilmos Papp, geändert vor 11 Jahren.

RE: Issue getting values from DB2.

Liferay Master Beiträge: 529 Beitrittsdatum: 21.10.10 Neueste Beiträge
Hi Anil,

Namespaces used to separate custom tables from core portal tables. I guess you could access your table remotely but keep in mind, that if you have WBNC scheme defined for the database of Liferay and you have WBNC as namespace for ServiceBuilder than you could use this form in your query: WBNC.WBNC_Search.

Regards,
Vilmos