Solved

How to use usebaen to connect to input data bean

Posted on 2007-03-21
1
328 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:
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
compre toata in where clue oracle 4 55
egit plugin on eclipse 8 28
factorial example 4 34
servlet filter example 37 34
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

919 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

13 Experts available now in Live!

Get 1:1 Help Now