Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to use usebaen to connect to input data bean

Posted on 2007-03-21
1
Medium Priority
?
359 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 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

670 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