Pinned topicNot able to create a SQL Call builder using EmployeeDatasource in IBM WASCE

‏2010-06-07T20:15:54Z
|Tags:

Answered question
This question has been answered.

Unanswered question
This question has not been answered yet.

Hi! ,

I am new to the portlet factory designer. I have very good knowledge on IBM portal but very less in portlet factory.

I am trying to do all the getting started kind of projects.
I am able to run the sample project
http://127.0.0.1:1346/help/index.jsp?topic=/com.bowstreet.designer.doc/tutorials/TutorialBasics_Quick_Start_WASCE.htm

but not able to create a SQL Call Builder to create some interactions with the database.

I tried the EmployeeDatasource keyword (entering into the builder fields) but the builder don't sense it and says its wrong. I am running Portlet factory designer onto the WAS CE. I have checked into WAS CE console the EmployeeDatasource but when i try to enter into the builder it says wrong.

Do we have simple link of tuorial or some hint to make it work. I am going crazy.

Attachments

Re: Not able to create a SQL Call builder using EmployeeDatasource in IBM WASCE

‏2010-06-16T20:05:48Z

This is the accepted answer.
This is the accepted answer.

It sounds like you are manually entering the value "EmployeeDatasource" into the DataSource input of the builder. Depending upon the app server valid dataSource names typically begin with "java:comp/env/" or "jdbc/". That's probably the issue here. Try pressing "Fetch DataSource Names" then see what names are listed in the DataSource input drop down. The listed names are those visible to WPF. If no names are displayed, then your deployed WAR does not have access to any datasources.

Re: Not able to create a SQL Call builder using EmployeeDatasource in IBM W

It sounds like you are manually entering the value "EmployeeDatasource" into the DataSource input of the builder. Depending upon the app server valid dataSource names typically begin with "java:comp/env/" or "jdbc/". That's probably the issue here. Try pressing "Fetch DataSource Names" then see what names are listed in the DataSource input drop down. The listed names are those visible to WPF. If no names are displayed, then your deployed WAR does not have access to any datasources.

Thanks Dave ! But when i am creating the portlet factory project WAR - a basic one and deploying onto the IBM WAACE the fetch data source is not generating the any enteries in the list. Now after drilling a lot I found I have to uncomment some stuff as per followign instructions:

"You will need to uncomment these references and modify them for your environment. The files you will be editing are the project's: WEB-INF/bin/deployment/wasce.web.xml and WEB-INF/geronimo-web.xml Be sure to "uncomment" the sample resource references, but leave the basic structure of these files in tact. "

Now I am able to get the EmployeeDataSource (out of box datasource that comes with the WASCE installtion) after clicking the fectch datasource.

I will be trying to do the same for the seperate ORACLE DB instance. Will it work ?

Overall - Do we have to make the manual changes and entries in these two xml files for this button to work (Fetch Datasource) ? Is this what I should keep in mind always ?

Re: Not able to create a SQL Call builder using EmployeeDatasource in IBM W

Thanks Dave ! But when i am creating the portlet factory project WAR - a basic one and deploying onto the IBM WAACE the fetch data source is not generating the any enteries in the list. Now after drilling a lot I found I have to uncomment some stuff as per followign instructions:

"You will need to uncomment these references and modify them for your environment. The files you will be editing are the project's: WEB-INF/bin/deployment/wasce.web.xml and WEB-INF/geronimo-web.xml Be sure to "uncomment" the sample resource references, but leave the basic structure of these files in tact. "

Now I am able to get the EmployeeDataSource (out of box datasource that comes with the WASCE installtion) after clicking the fectch datasource.

I will be trying to do the same for the seperate ORACLE DB instance. Will it work ?

Overall - Do we have to make the manual changes and entries in these two xml files for this button to work (Fetch Datasource) ? Is this what I should keep in mind always ?

You are correct: When using WAS CE, you will need to modify both files.

Here's an overview of one way:

Download and install a JDBC Driver
Download a JDBC driver for your database.
Log in to WAS CE Admin console.
Select "Repository" from the navigation. On the page that follows, upload the jdbc jar for the jdbc driver you downloaded. This makes it available to the appserver.

Modify WEB-INF/bin/deployment/wasce.web.xml and WEB-INF/geronimo-web.xml in your project
In the WAS CE Admin Console, click "Usage" for the datasouce you just created. This will give you the <dependency> and <resource-ref> sections you'll need when modifying these two files. Read closely. Also, you should change the <res-ref-name> to something more meaningful. For example, instead of <res-ref-name>jdbc/MyDataSource</res-ref-name>, you could choose <res-ref-name>jdbc/MyOracleDataSource</res-ref-name>

Re-deploy your project.

If there are no errors in your xml files, then your new DAtasource will show up in the builder's "SQL Datasource" input when you click Fetch Datasource Names

Re: Not able to create a SQL Call builder using EmployeeDatasource in IBM W

Thanks Dave ! But when i am creating the portlet factory project WAR - a basic one and deploying onto the IBM WAACE the fetch data source is not generating the any enteries in the list. Now after drilling a lot I found I have to uncomment some stuff as per followign instructions:

"You will need to uncomment these references and modify them for your environment. The files you will be editing are the project's: WEB-INF/bin/deployment/wasce.web.xml and WEB-INF/geronimo-web.xml Be sure to "uncomment" the sample resource references, but leave the basic structure of these files in tact. "

Now I am able to get the EmployeeDataSource (out of box datasource that comes with the WASCE installtion) after clicking the fectch datasource.

I will be trying to do the same for the seperate ORACLE DB instance. Will it work ?

Overall - Do we have to make the manual changes and entries in these two xml files for this button to work (Fetch Datasource) ? Is this what I should keep in mind always ?

You only need to modify these 2 files when you use WASCE as the dev server. WebSphere datasources are automatically made visible to the WPF WAR if you define them in a general enough scope to cover where WPF runs.

You must be using a release earlier than 6.1.5. As I recall, in 6.1.5 the sample WASCE datasource is automatically defined and available without needing to edit the deployment descriptors.

Re: Not able to create a SQL Call builder using EmployeeDatasource in IBM W

You are correct: When using WAS CE, you will need to modify both files.

Here's an overview of one way:

Download and install a JDBC Driver
Download a JDBC driver for your database.
Log in to WAS CE Admin console.
Select "Repository" from the navigation. On the page that follows, upload the jdbc jar for the jdbc driver you downloaded. This makes it available to the appserver.

Modify WEB-INF/bin/deployment/wasce.web.xml and WEB-INF/geronimo-web.xml in your project
In the WAS CE Admin Console, click "Usage" for the datasouce you just created. This will give you the <dependency> and <resource-ref> sections you'll need when modifying these two files. Read closely. Also, you should change the <res-ref-name> to something more meaningful. For example, instead of <res-ref-name>jdbc/MyDataSource</res-ref-name>, you could choose <res-ref-name>jdbc/MyOracleDataSource</res-ref-name>

Re-deploy your project.

If there are no errors in your xml files, then your new DAtasource will show up in the builder's "SQL Datasource" input when you click Fetch Datasource Names

Hi Sam,
I have the same problem(upon clicking "create table", it complains the datasource is not valid), even if I modified web.xml and geronimo-web.xml, the problem still exists. I also tried to modify wasce.web.xml under /WEB-INF/bin/deployment/, but the project cannot be deployed-the deploying process exited and didn't display any error message.