Solved

How to use usebaen to connect to input data bean

Posted on 2007-03-21
1
358 Views
Last Modified: 2013-12-22
Hi Guys

I am trying to use a usebean tag to connect to a  input data bean

Here is my code
--------------------------------
<wcbase:useBean id="SRSDB" classname="com.srs.common.reporting.beans.SRSReportingDataBean">
<% SRSDB.setResourceBundle("com.srs.common.properties.SRSReportingMessages"); %>
<% SRSDB.setSqlQuery("CATALOG"); %>
<% String[] reportResult = SRSDB.getReportResultSet(); %>
</wcbase:useBean>
----------------------------------------------

somehow this gives me a null pointer exception error, but if I try scriptlet code to connect to a data bean it works. Would you giuys know what I am doing wrong in the usebean code, Thanks

-------------------------------------------

<% System.out.println("TEST Before");
SRSReportingDataBean reportingDb = new SRSReportingDataBean();
reportingDb.setSqlQuery("CATALOG");
reportingDb.setResourceBundle("com.srs.common.properties.SRSReportingMessages");//USER_RESOURCE_BUNDLE
com.ibm.commerce.beans.DataBeanManager.activate(reportingDb, request, response);
System.out.println("Test "+reportingDb.getReportResultSet()[0]);
String []reportResult=reportingDb.getReportResultSet();
%>
----------------------------------------------------
0
Comment
Question by:huzefaq
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 30

Accepted Solution

by:
Mayank S earned 500 total points
ID: 18767461
2 differences that I can see are that you set the query before setting the resource-bundle (though I doubt if that has a dependency) and that you call DataBeanManager.activate () before calling getReportResultSet.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question