BIEE Result is NULL
Hi
I have created a some column on Answer. but the problem is that If the value is that column is 0 then it is showing nothing. And if next column is dependet on that column then the value of that column is also nothing. But In actual If value of column is null then I want 0 on that column. so that in next column is will show something. I have written some Query like that:
Suppose one column is good_Quality and that column is depended on sone column say Reson the I have written Query like that
FILTER(PRODUCTION_DATA.good_Quality USING (REASON_MASTER.REASON_ID = 7.00)). it is resulting correct result but is there is no column which have reason_id=7 then it is returning nothing.I want 0 on that place.
Thanks
Siddhartha P
Hi
In My case I have one column which is dependent on another column.
suppose other column is reasonId which have value between 1-10 and I want only value which is equal to 4.
so I have written Query like this
CASE WHEN "reason_id=4" THEN data_column else 0 END
It is giving me wrong answer. and this result chenges on other column like if I add this column 1st time then it shows some other result and if I add 2nd time then it is showing other result. May be you didnt get my Questiong but if you understand then just tell me.
Sometime I have seen this type of problem that adding more then 2 times any column the result is changes.
Thanks
Siddhartha P
Similar Messages
-
Hello techies,
I am doing simple program, which is connecting to mysql server and retreiving the results from my database using servlets.
I want to do if the result set is returning zero rows i.e if there is no matching rows is available in the table, which i had specified in my query.
Here is my code
String url = "jdbc:odbc:testDSN";
Properties p = new Properties();
p.put("user", "root");
p.put("password", "kkkk");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn = DriverManager.getConnection(url, p);
System.out.println("connection established");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select *from test.emp where empNumber =15");
System.out.println("resultset is null" + rs.wasNull());
if (rs.getRow() == 0) {
System.out.println("nomatching subject is found");
out.println("No Matching subject is found");
else {
out.println("<TABLE CELLSPACING=\"0\" CELLPADDING=\"3\" BORDER=\"1\">");
out.println("<TR><TH>eno</TH><TH>ename</TH><TH>date</TH></TR>");
// Loop through results of query.
while (rs.next() == true)
out.println("<TR>");
out.println("<TD>" + rs.getString("eno")+ "</TD>");
out.println("<TD>" + rs.getString("ename") + "</TD>");
out.println("<TD>" + rs.getString("date") + "</TD>");
out.println("</TR>");
Here if there are no employe record matching eno =15 in my table then i want to print no matching record is found.
where i am making mistake??
plz help me .
It is very urgent.
Thanks (inadvance)
regards,
ramuGood Lord, you have database and HTML generation code in the same method?
This is not the way to do JDBC code. Start with a tutorial.
Ever read about object-oriented programming? How 'bout starting with an Employee class that has id, name, and date (what date? birth date? employment date? termination date?) as attributes. Then write a data access object that can do all the database stuff on Employee's behalf, without any consideration for UI. Test that on the command line until you have it working perfectly. THEN worry about how you'll display results to the user.
Your JDBC code isn't right. wasNull() checks to see if the column result is null, not the result set itself. (ResultSet can never be null; read the javadocs). You'd be getting a NullPointerException if ResultSet was null, wouldn't you?
Your code deserves a SERIOUS rewrite, which I'm not inclined to do for you. But I would recommend something more along these lines:
// hardwired url, driver, and query? oh, my - that's bad.
String url = "jdbc:odbc:testDSN";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn = DriverManager.getConnection(url);
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select * from emp where empNumber =15");
// you're obviously putting this in a servlet - bad idea.
// ever heard of JSPs?
out.println("<TABLE CELLSPACING=\"0\" CELLPADDING=\"3\" BORDER=\"1\">");
out.println("<TR><TH>eno</TH><TH>ename</TH><TH >date</TH></TR>");
// Loop through results of query.
while (rs.next())
out.println("<TR>");
out.println("<TD>" + rs.getString("eno")+ "</TD>");
out.println("<TD>" + rs.getString("ename") + "</TD>");
out.println("<TD>" + rs.getString("date") + "</TD>");
out.println("</TR>");
}% -
Hello everyone.
I have a strange situation. Some times I have unfinished flows. The reason seems to be that some mappings (not specific ones) have status complete, start time and finished time the same and result null. After all my mappings I check for their result and wait this to be Success, Ok with Wornings or Failure. Because of this mapping returning null my flows stop and wait for manual termination.
Is there something that can be done?
I'm using OWF 2.6.4, OWB 10.2.0.2 and Oracle Database 10.2.0.3Not quite sure what you're asking. Does this help?
SQL> create table t (c number);
Table created.
SQL>
SQL> insert into t values (123);
1 row created.
SQL>
SQL> select * from t;
C
123
SQL>
SQL> update t set c = null;
1 row updated.
SQL>
SQL> select * from t;
C
SQL>
SQL> update t set c = 42;
1 row updated.
SQL>
SQL> select * from t;
C
42 -
Creating SC dependencies result in null pointer exception
Hi
I have installed JDI landscape and am nearly finished but I encounter a null pointer exception when I tried to adjust dependencies for my newly created SC and as a result I cannot create a track (no SCs could be added to it).
The exception is as follows:
java.lang.NullPointerException
at com.sap.sld.wd.softwarecatalog.CreateNewDependency.supplyFilteredSoftwareComponentVersions(CreateNewDependency.java:231)
at com.sap.sld.wd.softwarecatalog.wdp.InternalCreateNewDependency.supplyFilteredSoftwareComponentVersions(InternalCreateNewDependency.java:378)
at com.sap.sld.wd.softwarecatalog.wdp.IPrivateCreateNewDependency$IFilteredSoftwareComponentVersionsNode.doSupplyElements(IPrivateCreateNewDependency.java:1693)
at com.sap.tc.webdynpro.progmodel.context.Node.supplyElements(Node.java:406)
at com.sap.tc.webdynpro.progmodel.context.Node.getElementList(Node.java:345)
at com.sap.tc.webdynpro.progmodel.context.Node.getElements(Node.java:333)
at com.sap.tc.webdynpro.progmodel.context.Node.size(Node.java:721)
at com.sap.sld.wd.softwarecatalog.CreateNewDependency.onActionSort(CreateNewDependency.java:588)
at com.sap.sld.wd.softwarecatalog.CreateNewDependency.onActionAutoSort(CreateNewDependency.java:578)
at com.sap.sld.wd.softwarecatalog.wdp.InternalCreateNewDependency.onActionAutoSort(InternalCreateNewDependency.java:522)
at com.sap.sld.wd.softwarecatalog.CreateNewDependency.wdDoModifyView(CreateNewDependency.java:157)
at com.sap.sld.wd.softwarecatalog.wdp.InternalCreateNewDependency.wdDoModifyView(InternalCreateNewDependency.java:830)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:78)
at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:337)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:481)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:488)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doModifyView(WindowPhaseModel.java:551)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:148)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:299)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:759)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:712)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:261)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
PLEASE help me out
ThanksHi,
Did you create Product/Software Components in SLD? And did you define dependencies(the three standard SAP SCs) for the SC in SLD? Did you update CMS after you've created SCs/dependencies in SLD?
Thanks,
Rajit Srinivas -
How to ensure result of null will default to datatype of column
I have a question
suppose i have two tables with customers and Sales transactions
create SalesTransactionTBL
customerID
,itemID
,itemQuanity
,itemPrice
,orderDateTime
create customerTbl
customerID
customerName
Some customers have bought something as found in SalesTransactionTBL,
some just registered and hand't brought anything and not found in SalesTransactionTBL
If I left join two tables based on customerID, i will get null on many of the fields from SalesTransactionTbl
select *
from customerTbl c
left join SalesTransactionTBL s
on c.CustomerID =s.CustomerID
what is the way to ensure the result of the null value will default to something based on the data type of the column?What do you mean by ...
+what is the way to ensure the result of the null value will
default to something based on the data type of the column?+
Can you please describe / elaborate?
Why do you want to ensure this?
In Oracle, null value does not have a specific data type.
The data type of columns themself will (by default) will be based on data type of columns from base tables.
sudhakar@ORCL>drop table t1;
Table dropped.
sudhakar@ORCL>create table t1 (c1 int , s1 varchar2(20), d1 date);
Table created.
sudhakar@ORCL>drop table t2;
drop table t2
ERROR at line 1:
ORA-00942: table or view does not exist
sudhakar@ORCL>create table t2 (c2 int , s2 varchar2(20), d2 date);
Table created.
sudhakar@ORCL>
sudhakar@ORCL>insert into t1 values(1,'AAA',sysdate-3);
1 row created.
sudhakar@ORCL>insert into t1 values(2,'BBB',sysdate-2);
1 row created.
sudhakar@ORCL>commit;
Commit complete.
sudhakar@ORCL>select * from t1,t2
2 where c1 = c2(+);
C1 S1 D1 C2 S2 D2
1 AAA 06-MAY-10
2 BBB 07-MAY-10
sudhakar@ORCL>create view v1 as
2 select * from t1,t2
3 where c1 = c2(+);
View created.
sudhakar@ORCL>desc v1
Name Null? Type
C1 NUMBER(38)
S1 VARCHAR2(20)
D1 DATE
C2 NUMBER(38)
S2 VARCHAR2(20)
D2 DATE
sudhakar@ORCL> -
Html:link action html:link on results page null
I am sure that this is something simple and small but I have been banging my head against this problem for a while now.
I am using the <html:link> tag on my index.jsp page activates an action, retrieves a result and forwards to the homePage.jsp. The home page has a tiles layout and the results are actually in homePage_lowerLeftLevel.jsp within the homePage.jsp. Below the results I have an <html:link> tag which is identical to the tag in the index.jsp but now instead of seeing the link there is [ServletException in:/pages/homePage_leftLowerLevel.jsp] null' and if I go back to the index.jsp I get the following error�
java.lang.NullPointerException
at org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:313)
at index.jspService(index.jsp:29)
[SRC:/index.jsp]
at com.orionserver[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:57)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:356)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:498)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:402)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:673)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)
If this <html:link> tag is not on the results page the results display perfectly. Here is my code:
********index.jsp**************
<%@ page language="java" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<h2 class="lowerColumnHeader">Statistics</h2>
<table class="statisticsTable">
<tr>
<td>
ICF Published Parcels:
</td>
<td class="results">
<bean:write name="homePageForm" property="result" />
</td>
</tr>
</table>
<html:link page="/homePage.do?areaId=bcId">Click Me </html:link>
*********homePage_lowerLeftLevel.jsp*************
<%@ page language="java" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<h2 class="lowerColumnHeader">Statistics</h2>
<table class="statisticsTable">
<tr>
<td>
ICF Published Parcels:
</td>
<td class="results">
<bean:write name="homePageForm" property="result" />
</td>
</tr>
</table>
<html:link page="/homePage.do?areaId=bcId">Click Me </html:link>
*****************struts_config.xml**********************
<?xml version="1.0" encoding="ISO-8859-1" ?>
under the License.
-->
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://struts.apache.org/dtds/struts-config_1_3.dtd">
<struts-config>
<form-beans>
<form-bean name="homePageForm"
type="ca.bc.gov.srm.app.pip.HomePageForm" />
</form-beans>
<global-exceptions>
<!-- sample exception handler
<exception
key="expired.password"
type="app.ExpiredPasswordException"
path="/changePassword.jsp"/>
end sample -->
</global-exceptions>
<global-forwards>
<forward
name="homepage"
path="/homePage.do"/>
</global-forwards>
<action
path="/homePage"
name="homePageForm"
type="ca.bc.gov.srm.app.pip.action.HomePageAction"
scope="request"
validate="false"
input="/pages/homePage.jsp"/>
</action-mappings>
<message-resources parameter="MessageResources" />
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config"
value="/WEB-INF/tiles-defs.xml" />
<set-property property="moduleAware" value="true" />
</plug-in>
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/org/apache/struts/validator/validator-rules.xml,
/WEB-INF/validation.xml"/>
</plug-in>
</struts-config>
Thank you very much for your helpIt should be used something like this!!!
<html:link action="myStrutsAction" paramId="user" paramName="userName"/>if the userName attribute had the value "Bob" that would produce:
http://struts.apache.org/struts-doc-1.2.x/userGuide/struts-html.html#link -
OneToMany resulting in null field.
I'm attempting to implement the code example from the NetBeans magazine (Nov 2006) using NetBeans 6.0 beta 2 with glassfish-v2 -b58g. It's using a simple db structure with 3 tables:
[Platform] ---- [JSR] 1----* [Package]
I'm running into a problem with the 1 to many between JSR and Package.
The end result is that the jsr field in the inserted Package row is null.
Here's the JSR class (relevant pieces only, hopefully)
@Entity
public class JSR implements Serializable
private List<Package> packages;
@OneToMany(fetch=FetchType.EAGER, cascade=CascadeType.ALL,
mappedBy="jsr")
public List<Package> getPackages()
return packages;
public void setPackages(List<Package> packages)
this.packages = packages;
Here's the Package class
@Entity
public class Package implements Serializable
private JSR jsr;
@ManyToOne
public JSR getJsr()
return jsr;
public void setJsr(JSR jsr)
this.jsr = jsr;
Here's the code from a session bean that enters the data:
@Stateless
public class JavaPlatformManagerBean
implements JavaPlatformManagerRemote,
JavaPlatformManagerLocal
@PersistenceContext
private EntityManager em;
public void createPlatform(Platform platform)
em.merge(platform);
The code that calls the session bean (from a jsp backing bean)
public class JPMClient
@EJB
private JavaPlatformManagerRemote jpm;
public void createJavaSE()
JSR jsr1 = new JSR(176,
"Java SE 5 Release Contents",
new Package ("java.lang"),
new Package ("java.util"),
new Package ("java.sql"));
JSR jsr2 = new JSR(166,
"Concurrency Utilities",
new Package ("java.util.concurrent"));
Platform platform = new Platform ("Java SE 5", jsr1, jsr2);
jpm.createPlatform(platform);
And the results of quering the table (in Derby)
PACKAGE JSR_NUM
java.util.concurrent NULL
java.sql NULL
java.lang NULL
java.util NULL
I know this is long winded, but what am I missing in the JSR/Package classes such that the relationship back to the JSR is null?
Thanks for any insight.
GregMUnfortunately, AMF serialization is something of a black art. I'd run into multiple issues in the past (working with Granite DS, rather than Blaze--but it's essentially the same thing). I'm not sure about Blaze, but Granite has very verbose logging available if you configure log4j to DEBUG level for org.granite. The other alternative is to attach to your Java process with a debugger (Eclipse makes this fairly automagical), download the Blaze source and configure Blaze as a project in Eclipse, add it to source lookup for your project, and step through the actual serialization to see what's going on. This is moderately complicated to set up, but priceless when it comes to debugging.
-
How can the query results include null if it's a required field on the front end?
I executed a query that simply asked for all data points on a single table.
I am trying to figure out why the query would report back as having all "Null" values in 3 of 10 columns. The information is required for the end user to enter before the system allows
them save a record.You understand correctly.
When you look up de service code do you get an description from table DDLValues?
THIS IS CORRECT
If the service code is in there, you should check why de ID is not correct.
I dont know what this means. Check why the "ID" is not correct? What ID?
The DDLvalues table has no objects on which it depends. It that normal?
This is the code for the individual services
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[IndividualService](
[ID] [bigint] IDENTITY(1,1) NOT NULL,
[StudentID] [uniqueidentifier] NULL,
[DateofService] [datetime] NULL,
[ServiceCode] [int] NULL,
[FocusCode] [int] NULL,
[InterventionCode] [int] NULL,
[ClinicianID] [uniqueidentifier] NULL,
[Schoolid] [bigint] NULL,
[Approved] [int] NULL CONSTRAINT [DF_IndividualService_Approved] DEFAULT ((0)),
CONSTRAINT [PK_IndividualService] PRIMARY KEY CLUSTERED
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[IndividualService] WITH CHECK ADD CONSTRAINT [FK_IndividualService_aspnet_Users] FOREIGN KEY([StudentID])
REFERENCES [dbo].[Students] ([StudentID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_aspnet_Users]
GO
ALTER TABLE [dbo].[IndividualService] WITH CHECK ADD CONSTRAINT [FK_IndividualService_aspnet_Users1] FOREIGN KEY([ClinicianID])
REFERENCES [dbo].[aspnet_Users] ([UserId])
GO
ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_aspnet_Users1]
GO
ALTER TABLE [dbo].[IndividualService] WITH CHECK ADD CONSTRAINT [FK_IndividualService_DDLValues] FOREIGN KEY([FocusCode])
REFERENCES [dbo].[DDLValues] ([DDLValueID])
GO
ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_DDLValues]
GO
ALTER TABLE [dbo].[IndividualService] WITH CHECK ADD CONSTRAINT [FK_IndividualService_DDLValues1] FOREIGN KEY([InterventionCode])
REFERENCES [dbo].[DDLValues] ([DDLValueID])
GO
ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_DDLValues1]
GO
ALTER TABLE [dbo].[IndividualService] WITH CHECK ADD CONSTRAINT [FK_IndividualService_DDLValues2] FOREIGN KEY([ServiceCode])
REFERENCES [dbo].[DDLValues] ([DDLValueID])
GO
ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_DDLValues2]
GO
ALTER TABLE [dbo].[IndividualService] WITH CHECK ADD CONSTRAINT [FK_IndividualService_Schools] FOREIGN KEY([Schoolid])
REFERENCES [dbo].[Schools] ([SchoolID])
GO
ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_Schools]
GO -
ADF 10.1.2 - findDataControl(dataControlName) results in null pointer
I'm using ADF 10.1.2 with a flat JSP, no tricks or anything.
I've created an action event, which needs the application context, so I can call a business component.
When I call findDataControl(dataControlName) I get a null-pointer execption. The dataControlName is present in the binding context. It's been driving me crazy for weeks ... if anyone has an idea of where the issue could lie, please let me know.
Thanks.Hi,
Actually, this is only a very small extract of an existent large application. We currently do not have resource to upgrade it to 10.3, let alone 11g.
Please help.
Regards,
Michael -
"returning into" result is null with insert operation (only in apex)
I'm attempting to capture my primary key or the rowid identifying a particular row when inserted into a table (9.2.0.8) and placing it into an apex variable. I've not been successful using the following methodology. My plsql inserts my data into SM_ORDER successfully. Any suggestions?
MY TABLE -
CREATE TABLE "SM_ORDER"
+( "ORDER_ID" NUMBER NOT NULL ENABLE,+
++ "CUSTOMER_ID" NUMBER NOT NULL ENABLE,++
++ "SAMACCOUNTNAME" VARCHAR2(20) NOT NULL ENABLE,++
++ "ORDER_DATE" DATE NOT NULL ENABLE,++
++ CONSTRAINT "SM_ORDER_PK" PRIMARY KEY ("ORDER_ID") ENABLE++
+)+
+/+
CREATE OR REPLACE TRIGGER "BI_SM_ORDER"
before insert on "SM_ORDER"
for each row
begin
if :NEW."ORDER_ID" is null then
select "SM_ORDER_SEQ".nextval into :NEW."ORDER_ID" from dual;
end if;
end;
+/+
ALTER TRIGGER "BI_SM_ORDER" ENABLE
+/+
MY PLSQL -
declare
r rowid;
order_id_hold number;
begin
select SM_ORDER_SEQ.nextval
into order_id_hold
from dual;
insert into SM_ORDER (CUSTOMER_ID,
SAMACCOUNTNAME,
ORDER_DATE)
values (:F111_CURRENT_CUSTOMER,
+:APP_USER,+
SYSDATE)
returning ORDER_ID
into order_id_hold;
+:P5_ORDER_ID_HOLD := order_id_hold;+
end;
NOTE: If I do it as a straight SQL statement, it works fine.
declare
r rowid;
order_id_hold number;
begin
select SM_ORDER_SEQ.nextval
into order_id_hold
from dual;
insert into SM_ORDER (CUSTOMER_ID,
SAMACCOUNTNAME,
ORDER_DATE)
values (:F111_CURRENT_CUSTOMER,
+:APP_USER,+
SYSDATE)
returning ORDER_ID
into order_id_hold;
dbms_output.put_line (order_id_hold);
end;
+/+
*49*
*1 row(s) inserted.*
*0.04 seconds*
Thank you!
PaulI have something similar in one of my applications.
Have you tried it like this?
CREATE OR REPLACE TRIGGER "BI_SM_ORDER"
before insert on "SM_ORDER"
for each row
l_order_id number;
begin
select SM_ORDER_SEQ.nextval into l_order_id from dual;
:NEW.ORDER_ID := l_order_id;
end;
*Your PLSQL* -
declare
r rowid;
order_id_hold number;
begin
insert into SM_ORDER (CUSTOMER_ID,
SAMACCOUNTNAME,
ORDER_DATE)
values (:F111_CURRENT_CUSTOMER,
:APP_USER,
SYSDATE)
returning ORDER_ID
into order_id_hold;
:P5_ORDER_ID_HOLD := order_id_hold;
end;The if-then in your trigger was redundant, so was the select-nextval in your PL/SQL. This exact structure works for me. -
Generated webservices give null result in Flex 3
Hi there, I have a web service on my localhost. Calling this from a PHP page works fine and it returns the expected results. (I pass 2 values and it returns a different string depending on the values passed).
However, in Flex 3, I have generated the webservice proxy classes using the "Data" | "Manage Web Services" dialog. I am consuming these services using the following code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Button click="clickHandler(event)"/>
<mx:Script>
<![CDATA[
import generated.webservices.*;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
public var _ws:SalesService = new SalesService();
private function clickHandler(_e:MouseEvent):void
_ws.addonsaleEventListener(resultHandler);
_ws.addSalesServiceFaultEventListener(faultHandler);
_ws.onsale(10,90);
public function resultHandler(_e:OnsaleResultEvent):void
if(_e.result == null)
Alert.show("result is: null");
else
Alert.show("result is: "+_e.result);
public function faultHandler(_e:FaultEvent):void
Alert.show(_e.message.toString());
]]>
</mx:Script>
</mx:Application>
The "resultHandler" method is called and the "faultHandler" method is not called, which suggests a result is returned, but _e.result is null in the "resultHandler" method.
Can anyone see if I am missing something in the actionscript?
Andrew.
p.s.
I can post the generated proxy classes, or even the wsdl for the webservice if it helps.
A.No, they're not exactly the same (see below).
Calling the same web service; Flex 3 is generating a
different result object than Flex 2, and therefore can/will not
type the results as the Array my original app had come to expect.
Is this by design?
A suggested code revision would help, but...
The question in my
original post is still in play:
Where would I have gone to learn this? The release notes are
simply a cut list of changes. Is there a resource which summarizes
the types of errors one is likely to see when porting a Flex 2 app
to Flex 3, along with the most-likely changes as causes? When CFMX
was first released, there was a helpful checklist of tags and
syntax to help you audit your CF5 for the upgrade. Has one of your
gurus blogged something like this for FX3 and I just can't find it? -
How to know that result of query is null?
i connected to the database using that could and the result where 0 records how can i manage that if the result is 0 records don't show anything. i mean how to make the check condition that the result is null.
<%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
<br>
<jbo:ApplicationModule id="package2.Package2Module" configname="package2.Package2Module.Package2ModuleLocal" username="system" password="manager"/>
<br>
<jbo:DataSource id="ds" appid="package2.Package2Module" viewobject="StudentsView" whereclause="<%= wc %>" />
<br>I think that you have only created an array of the
given size [60][2], but you haven't actually put
anything into the position str[3][0]. This would
explain why you are getting a null pointer exception.But he's explicitly checking for null, that shouldn't cause a null pointer exception.
OP: please post your actual code, and the actual null pointer exception. -
We are working with the beta release 3.0c of Forte and 2.0c of express. We
have several DateTime domain fields for which we need to have nulls carried
through and updated on the data base. Ideally when the user selects the
insert button and the new record is initialized we would like to place
nulls in those fields before the display and then have those nulls
maintained through the data base update. If the user keys a valid date in
one or more of those fields then the non-null date values would be carried.
Conversely, if a date is present we would like to be able to have the user
delete the date field resulting in nulls being carried forward.
We have made several attempts to null these date fields
(PlaceValueInDisplayField, SetValuesInNewRecord, overriding the
InsertRecordIntoResultSet method, overriding the newobject method) with no
success.
Has anyone been successful in nulling date fields? Thanks.Donald R. Smith wrote:
>
We are working with the beta release 3.0c of Forte and 2.0c of
express. We
have several DateTime domain fields for which we need to have nulls
carried
through and updated on the data base. Ideally when the user selects
the
insert button and the new record is initialized we would like to place
nulls in those fields before the display and then have those nulls
maintained through the data base update. If the user keys a valid
date in
one or more of those fields then the non-null date values would be
carried.
Conversely, if a date is present we would like to be able to have the
user
delete the date field resulting in nulls being carried forward.
We have made several attempts to null these date fields
(PlaceValueInDisplayField, SetValuesInNewRecord, overriding the
InsertRecordIntoResultSet method, overriding the newobject method)
with no
success.
Has anyone been successful in nulling date fields? Thanks.gbkhor wrote:
1. Create a new domain class say, NewDateTimeNullable which superclass
is DateTimeNullable.
2. At the NewDateTimeNullable Init() method, do Self.IsNull = TRUE this
will set the initial value to null.
Ideally when the user selects the insert button and the new record is initialized we would like to
place nulls in those fields before the display and then have those nulls maintained through the data
base update.3. At the Application modal(Express), for all the datetime class which
would like to behave like you mention above, change the data type to
NewDateTimeNullable.
If the user keys a valid date in one or more of those fields then the non-null date values would be carried.
Conversely, if a date is present we would like to be able to have the user delete the date field resulting
in nulls being carried forward.4. Upon insertion or save do check
- If Variable.IsNull then
else If Variable.IsEqual('') then
Variable.IsNull = TRUE;
end if;
end if;
Hope this will help.
My URL http://www.geocities.com/Hollywood/Lot/3985/
BASS Consulting Sdn. Bhd.
8th Floor, Menara SMI,
6 Lorong P. Ramlee,
50250 Kuala Lumpur,
West Malaysia.
Tel. (603) 2305588 ext. 995
Fax. (603) 2019403 -
Why am I receiving Null pointer Exception Error.
why am I receiving Null pointer Exception Error.
Hi I am developing a code for login screen. There is no syntex error as such ut I am receving the aove mentioned error. Can some one please help me ??
------------ Main.java------------------
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class Main implements ActionListener
Frame mainf;
MenuBar mb;
MenuItem List,admitform,inquiry,exit,helpn;
Menu newm,update,help;
Inquiry iq;
Admit ad;
// HosHelp hp;
Howuse hu;
Register reg;
Main()
mainf=new Frame(" Engg College V/S Mumbai University ");
mb=new MenuBar();
newm=new Menu(" New ");
update=new Menu(" Update ");
help=new Menu(" Help ");
List=new MenuItem("List");
admitform=new MenuItem("Admit");
inquiry=new MenuItem("Inquiry");
exit=new MenuItem("Exit");
helpn=new MenuItem("How to Use?");
newm.add(List);
newm.add(admitform);
newm.add(inquiry);
newm.add(exit);
help.add(helpn);
mb.add(newm);
mb.add(update);
mb.add(help);
mainf.setMenuBar(mb);
exit.addActionListener(this);
List.addActionListener(this);
inquiry.addActionListener(this);
admitform.addActionListener(this);
helpn.addActionListener(this);
mainf.setSize(400,300);
mainf.setVisible(true);
public void actionPerformed(ActionEvent ae)
if (ae.getSource()==List)
reg=new Register();
if(ae.getSource()==inquiry)
iq=new Inquiry();
if(ae.getSource()==admitform)
ad=new Admit();
if(ae.getSource()==helpn)
hu=new Howuse();
if(ae.getSource()==exit)
mainf.setVisible(false);
public static void main(String args[])
new Main();
-------------Register.java---------------------------
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class Register implements ActionListener//,ItemListener
Label id,name,login,pass,repass;
Button ok,newu,cancel,check;
Button vok,iok,lok,mok,sok; //buttons for dialog boxes
TextField idf,namef,loginf,passf,repassf;
Dialog valid,invlog,less,mismat,acucreat;
Frame regis;
Checkbox admin,limit;
CheckboxGroup type;
DBconnect db;
Register()
db=new DBconnect();
regis=new Frame("Registeration Form");
type=new CheckboxGroup();
admin=new Checkbox("Administrator",type,true);
limit=new Checkbox("Limited",type,false);
id=new Label("ID :");
name=new Label("Name :");
login=new Label("Login :");
pass=new Label("Password :");
repass=new Label("Retype :");
idf =new TextField(20); idf.setEnabled(false);
namef=new TextField(30); namef.setEnabled(false);
loginf=new TextField(30); loginf.setEnabled(false);
passf=new TextField(30); passf.setEnabled(false);
repassf=new TextField(30); repassf.setEnabled(false);
ok=new Button("OK"); ok.setEnabled(false);
newu=new Button("NEW");
cancel=new Button("Cancel");
check=new Button("Check Login"); check.setEnabled(false);
vok=new Button("OK");
iok=new Button("OK");
lok=new Button("OK");
mok=new Button("OK");
sok=new Button("OK");
valid=new Dialog(regis,"Login name is valid !");
invlog=new Dialog(regis,"Login name already exist!");
less=new Dialog(regis,"Password is less than six characters !");
mismat=new Dialog(regis,"password & retyped are not matching !");
acucreat=new Dialog(regis,"You have registered successfully !");
regis.setLayout(null);
// regis.setBackground(Color.orange);
valid.setLayout(new FlowLayout());
invlog.setLayout(new FlowLayout());
less.setLayout(new FlowLayout());
mismat.setLayout(new FlowLayout());
acucreat.setLayout(new FlowLayout());
id.setBounds(35,50,80,25); //(left,top,width,hight)
idf.setBounds(125,50,40,25);
name.setBounds(35,85,70,25);
namef.setBounds(125,85,150,25);
login.setBounds(35,120,80,25);
loginf.setBounds(125,120,80,25);
check.setBounds(215,120,85,25);
pass.setBounds(35,155,80,25);
passf.setBounds(125,155,80,25);
repass.setBounds(35,190,80,25);
repassf.setBounds(125,190,80,25);
admin.setBounds(35,225,100,25);
limit.setBounds(145,225,100,25);
ok.setBounds(45,265,70,25);
newu.setBounds(135,265,70,25);
cancel.setBounds(225,265,70,25);
passf.setEchoChar('*');
repassf.setEchoChar('*');
regis.add(id);
regis.add(idf);
regis.add(name);
regis.add(namef);
regis.add(login);
regis.add(loginf);
regis.add(check);
regis.add(pass);
regis.add(passf);
regis.add(repass);
regis.add(repassf);
regis.add(ok);
regis.add(newu);
regis.add(cancel);
regis.add(admin);
regis.add(limit);
valid.add(vok);
invlog.add(iok);
less.add(lok);
mismat.add(mok);
acucreat.add(sok);
ok.addActionListener(this);
newu.addActionListener(this);
check.addActionListener(this);
cancel.addActionListener(this);
// limit.addItemListener(this);
//admin.addItemListener(this);
vok.addActionListener(this);
iok.addActionListener(this);
lok.addActionListener(this);
mok.addActionListener(this);
sok.addActionListener(this);
regis.setLocation(250,150);
regis.setSize(310,300);
regis.setVisible(true);
public void actionPerformed(ActionEvent ae)
if(ae.getSource()==check)
try{
String s2=loginf.getText();
ResultSet rs=db.s.executeQuery("select* from List");
while(rs.next())
if(s2.equals(rs.getString(2).trim()))
// invlog.setBackground(Color.orange);
invlog.setLocation(250,150);
invlog.setSize(300,100);
cancel.setEnabled(false);
ok.setEnabled(false);
check.setEnabled(false);
invlog.setVisible(true);
break;
else
// valid.setBackground(Color.orange);
valid.setLocation(250,150);
valid.setSize(300,100);
cancel.setEnabled(false);
ok.setEnabled(false);
check.setEnabled(false);
valid.setVisible(true);
}catch(Exception e)
e.printStackTrace();
if(ae.getSource()==newu)
try{
ResultSet rs=db.s.executeQuery("select max(ID) from List");
while(rs.next())
String s1=rs.getString(1).trim();
int i=Integer.parseInt(s1);
i++;
String s2=""+i;
idf.setText(s2);
newu.setEnabled(false);
namef.setText(""); namef.setEnabled(true);
loginf.setText(""); loginf.setEnabled(true);
passf.setText(""); passf.setEnabled(true);
repassf.setText(""); repassf.setEnabled(true);
ok.setEnabled(true);
check.setEnabled(true);
}catch(Exception e)
e.printStackTrace();
if(ae.getSource()==ok)
try
String s1=idf.getText();
String s2=loginf.getText();
String s3=passf.getText();
String s4=repassf.getText();
int x=Integer.parseInt(s1);
int t;
if(type.getSelectedCheckbox()==admin)
t=1;
else
t=0;
ResultSet rs=db.s1.executeQuery("select* from List");
while(rs.next())
if(s2.equals(rs.getString(2).trim()))
invlog.setBackground(Color.orange);
invlog.setLocation(250,150);
invlog.setSize(300,100);
cancel.setEnabled(false);
ok.setEnabled(false);
check.setEnabled(false);
invlog.setVisible(true);
break;
else
if (s3.length()<6)
less.setBackground(Color.orange);
less.setLocation(250,150);
less.setSize(300,100);
ok.setEnabled(false);
cancel.setEnabled(false);
check.setEnabled(false);
less.setVisible(true);
else if(!(s3.equals(s4)))
mismat.setBackground(Color.orange);
mismat.setLocation(250,150);
mismat.setSize(300,100);
ok.setEnabled(false);
cancel.setEnabled(false);
check.setEnabled(false);
mismat.setVisible(true);
else
db.s1.execute("insert into User values("+x+",'"+s2+"','"+s3+"',"+t+")");
acucreat.setBackground(Color.orange);
acucreat.setLocation(250,150);
acucreat.setSize(300,100);
regis.setVisible(false);
acucreat.setVisible(true);
}//else
}//while
} //try
catch(Exception e1)
// e1.printStackTrace();
if (ae.getSource()==cancel)
regis.setVisible(false);
if (ae.getSource()==vok)
ok.setEnabled(true);
cancel.setEnabled(true);
check.setEnabled(true);
valid.setVisible(false);
if (ae.getSource()==iok)
ok.setEnabled(true);
cancel.setEnabled(true);
check.setEnabled(true);
invlog.setVisible(false);
if (ae.getSource()==lok)
less.setVisible(false);
cancel.setEnabled(true);
ok.setEnabled(true);
check.setEnabled(true);
if (ae.getSource()==mok)
mismat.setVisible(false);
cancel.setEnabled(true);
ok.setEnabled(true);
check.setEnabled(true);
if (ae.getSource()==sok)
acucreat.setVisible(false);
ok.setEnabled(false);
newu.setEnabled(true);
regis.setVisible(true);
public static void main(String args[])
new Register();
-----------DBConnect.java------------------------------------
import java.sql.*;
public class DBconnect
Statement s,s1;
Connection c;
public DBconnect()
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
c=DriverManager.getConnection("jdbc:odbc:Sonal");
s=c.createStatement();
s1=c.createStatement();
catch(Exception e)
e.printStackTrace();
----------Login.java----------------
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class Login implements ActionListener
Frame log;
Label login,pass;
TextField loginf,passf;
Button ok,cancel;
Dialog invalid;
Button iok;
Register reg;
DBconnect db;
Main m;
Login()
db=new DBconnect();
log=new Frame();
log.setLocation(250,210);
login=new Label("Login :");
pass=new Label("Password :");
loginf=new TextField(20);
passf=new TextField(20);
passf.setEchoChar('*');
ok=new Button("OK");
// newu=new Button("New User");
cancel=new Button("CANCEL");
iok=new Button(" OK ");
invalid=new Dialog(log,"Invalid User!");
//log.setBackground(Color.cyan);
//log.setForeground(Color.black);
log.setLayout(null);
// iok.setBackground(Color.gray);
invalid.setLayout(new FlowLayout());
login.setBounds(35,50,70,25); //(left,top,width,hight)
loginf.setBounds(105,50,100,25);
pass.setBounds(35,85,70,25);
passf.setBounds(105,85,70,25);
ok.setBounds(55,130,70,25);
// newu.setBounds(85,120,80,25);
cancel.setBounds(145,130,70,25);
log.add(login);
log.add(loginf);
log.add(pass);
log.add(passf);
log.add(ok);
// log.add(newu);
log.add(cancel);
invalid.add(iok);//,BorderLayout.CENTER);
ok.addActionListener(this);
// newu.addActionListener(this);
cancel.addActionListener(this);
iok.addActionListener(this);
log.setSize(300,170);
log.setVisible(true);
public void actionPerformed(ActionEvent a)
if(a.getSource()==ok)
try{
String l=loginf.getText();
String p=passf.getText();
ResultSet rs=db.s.executeQuery("select * from List");
while(rs.next())
if(l.equals(rs.getString(2).trim())&& p.equals(rs.getString(3).trim()))
String tp=rs.getString(4).trim();
int tp1=Integer.parseInt(tp);
log.setVisible(false);
if(tp1==1)
m=new Main();
// m.List.setEnabled(true);
else
m=new Main();
m.List.setEnabled(false);
break;
else
invalid.setBackground(Color.orange);
invalid.setSize(300,100);
invalid.setLocation(250,210);
cancel.setEnabled(false);
ok.setEnabled(false);
invalid.setVisible(true);
}catch(Exception e1)
e1.printStackTrace();
if (a.getSource()==cancel)
log.setVisible(false);
if (a.getSource()==iok)
invalid.setVisible(false);
loginf.setText("");
passf.setText("");
cancel.setEnabled(true);
ok.setEnabled(true);
public static void main(String[] args)
new Login();
-------------inquiry.java---------------------------------
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.util.Date;
import java.text.*;
import java.sql.*;
public class Inquiry implements ActionListener
Frame inqry;
Label name,addr;
TextField namef,addrf;
Button ok,cancel,dok;
Dialog invalid;
Frame result; //Result of the inquiry....
Label lrname,lraddr,lward,lrdate,lcdate;
TextField rname,raddr,ward,rdate,cdate;
Date d;
DateFormat df;
Button rok,rcancel;
Dialog success;
Button rdok;
DBconnect db;
Inquiry()
db=new DBconnect();
inqry=new Frame("Inquiry Form");
inqry.setLayout(null);
inqry.setBackground(Color.cyan);
name=new Label(" NAME ");
addr=new Label("ADDRESS");
namef=new TextField(20);
addrf=new TextField(20);
ok=new Button("OK");
cancel=new Button("CANCEL");
dok=new Button("OK");
invalid=new Dialog(inqry,"Invalid Name or Address !");
invalid.setSize(300,100);
invalid.setLocation(300,180);
invalid.setBackground(Color.orange);
invalid.setLayout(new FlowLayout());
result=new Frame(" INQUIRY RESULT "); //Result Window......
result.setLayout(null);
result.setBackground(Color.cyan);
lcdate=new Label(" DATE ");
lrname=new Label(" NAME ");
lraddr=new Label(" ADDRESS ");
lward=new Label(" WARD ");
lrdate=new Label(" ADMIT-DATE ");
cdate=new TextField(10);
rname=new TextField(20);
rname.setEnabled(false);
raddr=new TextField(20);
raddr.setEnabled(false);
ward=new TextField(20);
ward.setEnabled(false);
rdate=new TextField(10);
rdate.setEnabled(false);
cdate=new TextField(20);
d=new Date();
df=DateFormat.getDateInstance(DateFormat.MEDIUM,Locale.KOREA);
cdate.setText(df.format(d));
cdate.setEnabled(false);
rok=new Button(" OK ");
rcancel=new Button("CANCEL");
name.setBounds(40,50,50,25);
namef.setBounds(120,50,130,25);
addr.setBounds(40,100,60,25);
addrf.setBounds(120,100,80,25);
ok.setBounds(60,145,70,25);
cancel.setBounds(140,145,70,25);
lcdate.setBounds(200,50,60,25); //Result Window......
cdate.setBounds(270,50,80,25);
lrname.setBounds(35,85,70,25);
rname.setBounds(140,85,180,25);
lraddr.setBounds(35,120,80,25);
raddr.setBounds(140,120,100,25);
lward.setBounds(35,155,80,25);
ward.setBounds(140,155,100,25);
lrdate.setBounds(30,190,80,25);
rdate.setBounds(140,190,80,25);
rok.setBounds(70,240,70,25);
rcancel.setBounds(170,240,70,25);
inqry.add(name);
inqry.add(namef);
inqry.add(addr);
inqry.add(addrf);
inqry.add(ok);
inqry.add(cancel);
invalid.add(dok);
result.add(lcdate); //Result Window......
result.add(cdate);
result.add(lrname);
result.add(rname);
result.add(lraddr);
result.add(raddr);
result.add(lward);
result.add(ward);
result.add(lrdate);
result.add(rdate);
result.add(rok);
result.add(rcancel);
ok.addActionListener(this);
cancel.addActionListener(this);
dok.addActionListener(this);
rok.addActionListener(this); //Result Window......
rcancel.addActionListener(this);
inqry.setSize(280,180);
inqry.setLocation(300,180);
inqry.setVisible(true);
result.setSize(400,280); //Result Window......
result.setLocation(200,150);
result.setVisible(false);
public void actionPerformed(ActionEvent ae)
if(ae.getSource()==ok)
try
String nm=namef.getText();
String ad=addrf.getText();
inqry.setVisible(false);
ResultSet rs=db.s.executeQuery("select * from Billinformation");
while(rs.next())
String nm1=rs.getString(2).trim();
String ad1=rs.getString(3).trim();
int k=0;
if((nm1.equals(nm))&&(ad1.equals(ad)))
String adm=rs.getString(5).trim();
String wr=rs.getString(6).trim();
String bd=rs.getString(8).trim();
String wrb=wr+"-"+bd;
result.setVisible(true);
rname.setText(nm1);
raddr.setText(ad1);
ward.setText(wrb);
rdate.setText(adm);
k=1;
break;
}//if
else if(k==1)
invalid.setVisible(true);
}//while
}//try
catch(Exception e)
e.printStackTrace();
} //getsource ==ok
if(ae.getSource()==cancel)
inqry.setVisible(false);
if(ae.getSource()==rok) //Result Window......
namef.setText("");
addrf.setText("");
result.setVisible(false);
inqry.setVisible(true);
if(ae.getSource()==rcancel)
result.setVisible(false);
if(ae.getSource()==dok)
namef.setText("");
addrf.setText("");
invalid.setVisible(false);
inqry.setVisible(true);
public static void main(String args[])
new Inquiry();
PLease Help me !!
I need this urgently.can you explain what your program tries to do... and
at where it went wrong..Sir,
We are trying to make an project where we can make a person register in our data base & after which he/she can search for other user.
The logged in user can modify his/her own data but can view other ppl's data.
We are in a phase of registering the user & that's where we are stuck. The problem is that after the login screen when we hit register (OK- button) the data are not getting entered in the data base.
Can u please help me??
I am using "jdk1.3' - studnet's edition.
I am waiting for your reply.
Thanks in advance & yr interest. -
GetParameter() null value
Hi all,
We are having a problem using the request.getParameter(String) method. We are using the method to define an argument for a Java Webstart (jnlp mime type) file we are creating with jsp. Other arguments have been successfully created using the request.getServerName() and request.getRequestURI() methods. The getParameter() return value looks fine if printed back to HTML. The jsp file creating the jnlp file is called using an HREF created inside another jsp file as follows:
<a href="xmlfetch.jsp?filename=mti.xml""></a>
The param value for filename in each HREF is filled using an String array entry (i.e. +names).
The xmlfetch.jsp file uses StringBuffers to capture/store the servername, uri and param data as follows:
StringBuffer svrname = new StringBuffer();
svrname.append(request.getServerName());
StringBuffer requri = new StringBuffer();
requri.append(request.getRequestURI());
StringBuffer fname = new StringBuffer();
fname.append(request.getParameter("filename"));
All 3 variables look ok if dumped in html as follows:
out.println("svrname=" +svrname);
out.println("requri=" +requri);
out.println("fname=" +fname);
But only the param value is null when the variables are passed as arguments in the jnlp stream as follows:
<argument><%=svrname.toString()%></argument>
<argument><%=requri.toString()%></argument>
<argument><%=fname.toString()%></argument>
So the question is ... why do the parameter values evaluate to non null when dumped to html but become null when used as an argument for jnlp? AND what is the difference between the strings returned by the 3 request methods we are using as arguments (i.e. why do 2/3 work?).
ANY HELP APPRECIATED:)
Greg Hock
Software Engr
Northrop Grumman Corp.
(321) 726-7758
[email protected]I have tried the parameter specification both with and without quotes but either case results in null value for argument going into the Java Webstart (.jnlp) file that I create in the second jsp file (xmlfetch.jsp). What I don't understand is why the parameter looks correct when sent out.println() but is null when not printed and only used for the jnlp app argument. Both the other variables assigned using request.getXXX() methods are ok as arguments...only the parameters passed from the first jsp page (mtiquery.jsp) to the second jsp page (xmlfetch.jsp) become null when used as the jnlp argument.
Anyone ... please help. :)
Here is the code for the first jsp page. This page creates a table of filenames each of which has a href link to the second jsp page and passes it's filename as the parameter.
<%@ page
language="java"
import="java.util.*,java.text.*,java.io.*,javax.swing.filechooser.FileFilter"
%>
<html>
<title>MTIX MTI Query Tool</title>
<body>
<p>
<center>
<h1>JSP MTI QueryTest</h1><br>
<jsp:include page="copyright.jsp" flush="true"/>
<br>
<%=(new java.util.Date())%>
<%
String startPath = "../webapps/ATServlets/data/mti";
File myDir = new File(startPath);
String myPath = myDir.getCanonicalPath();
out.println("<br><br><br>Results of Query Path: <br>" myPath "<br><br>");
String[] filelist = myDir.list();
out.println("<br>");
out.println("<center>");
out.println("<table BORDER COLS=1 width=400>");
String urlPath = null;
String hrefPath = null;
for (int i=0; i<filelist.length; i++)
urlPath = new String("\"http://judy:8080/ATServlets/jsp/xmlfetch.jsp?filename="+filelist[i]+ "\"");
hrefPath = new String("<a href=" urlPath ">");
out.println("<tr><td><center>");
out.println(hrefPath + filelist[i] + "</a>");
out.println("</center></td></tr>");
out.println("</table>");
out.println("</center>");
%>
</center>
</body>
</html>
This first page resulted in source as follows:
NOTICE that the second jsp page is the HREF and I am using "filename" as the parameter key and the value is assigned (without quotes) to be the filelist entry.
<html>
<title>MTIX MTI Query Tool</title>
<body>
<p>
<center>
<h1>JSP MTI QueryTest</h1><br>
<html>
<head>
<title></title>
</head>
<body>
<p>(c) 1999,2000,2001 Northrop-Grumman All Rights Reserved </p>
</body>
</html>
<br>
Wed Aug 08 10:01:34 EDT 2001
<br><br><br>Results of Query Path: <br>/opt/mtix/data/mti<br><br>
<br>
<center>
<table BORDER COLS=1 width=400>
<tr><td><center>
MtiOutput.xml
</center></td></tr>
<tr><td><center>
KoreaMTI.xml
</center></td></tr>
<tr><td><center>
testMti.xml
</center></td></tr>
<tr><td><center>
testMti2.xml
</center></td></tr>
<tr><td><center>
testMti4.xml
</center></td></tr>
</table>
</center>
</center>
</body>
</html>
OK Now here is the second jsp file (xmlfetch.jsp) that is fired up after the table selection. This file creates a stream to the Java Webstart plugin and tries to use the passed parameter as 1 of 3 arguments to the application (see last few lines). The variable fname is used to hold the contents of the getParameter() method.
<%@ page
contentType="application/x-java-jnlp-file"
info="myjnlp"
import="java.lang.*,java.text.*,java.io.*"
%>
<%
StringBuffer fname = new StringBuffer();
fname.append(request.getParameter("filename"));
//fname.append("MtiOutput.xml");
//out.println("the fname var = " +fname);
StringBuffer cBase = new StringBuffer();
cBase.append(!request.isSecure() ? "http://" : "https://");
cBase.append(request.getServerName());
if(request.getServerPort() != (request.isSecure() ? 80 : 443))
cBase.append(':');
cBase.append(request.getServerPort());
StringBuffer httpref = new StringBuffer();
httpref = cBase;
httpref.append(request.getRequestURI());
StringBuffer cBase2 = new StringBuffer();
cBase2.append(!request.isSecure() ? "http://" : "https://");
cBase2.append(request.getServerName());
if(request.getServerPort() != (request.isSecure() ? 80 : 443))
cBase2.append(':');
cBase2.append("80");
cBase2.append('/');
cBase2.append("ATJava");
cBase2.append('/');
%>
<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for downloading xml from servlet -->
<jnlp
spec="1.0"
codebase="<%=cBase2.toString()%>"
href="<%=httpref.toString()%>">
<information>
<title>Catalog Download Application</title>
<vendor>Northrop Grumman, Inc.</vendor>
<homepage href="ATJava.init/documents/index.html"/>
<description>XML Catalog Download Application>
<description kind="short">A demo.</description>
<icon href="ATJava.init/images/tomcat.gif"/>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.2" initial-heap-size="16m" max-heap-size="512m"/>
<jar href="ATJava.build/ATJava.jars/ATSignedRuntime.jar" download="eager"/>
</resources>
<resources>
<j2se version="1.3" initial-heap-size="16m" max-heap-size="512m"/>
<jar href="ATJava.build/ATJava.jars/ATSignedRuntime.jar" download="eager"/>
</resources>
<application-desc main-class="mtix.XMLFetch">
<argument><%=fname.toString()%></argument>
<argument><%=cBase2.toString()%></argument>
<argument><%=httpref.toString()%></argument>
</application-desc>
</jnlp>
Please HELP/COMMENT if you can.... Gregg
Maybe you are looking for
-
Video podcasts no longer sync with iPod Touch
I am using latest version of iTunes 10.1.1 (4) and latest os 10.6.5 on MacBook Pro with iPod Touch (gen 3). I subscribe to a video podcast and in beginning it worked, but for last 2 months though they download into iTunes and I can watch them, they a
-
I am running java program in dos mode. Actually I want to pause the program when the program is running. How should I do that? Is there any keystroke? How to resume, if we pause the program? Thanks
-
My nforce 420D is still causing troubles with networking... it keeps dropping out and there are alot of performance issues as well. Is there work around for this issue? Thanks
-
Is there a way to reverse the latest numbers update to the previous version?
-
When published iWeb then visit, no updates...what happened?
I am creating my website and clicked published and then i wanted to visit my site, when i do there are no updates - what happened?