Solved

How to use usebaen to connect to input data bean

Posted on 2007-03-21
1
317 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
1 Comment
 
LVL 30

Accepted Solution

by:
mayankeagle 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now