how pass listbox value in SessionBean1 for query parameter

hi master

sir i use your given sample with my 10g table

i fasing porblem in SessionBean1 for query parameter

sir how i pass value in query for where class

this is my SessionBean1 query

SELECT ALL MUHAMMAD.VOUDETAIL.VNO,

MUHAMMAD.VOUDETAIL.ACCID,

MUHAMMAD.VOUDETAIL.NARRATION,

MUHAMMAD.VOUDETAIL.REFNO,

MUHAMMAD.VOUDETAIL.DEPTID,

MUHAMMAD.VOUDETAIL.DEBIT,

MUHAMMAD.VOUDETAIL.CREDIT,

MUHAMMAD.VOUDETAIL.REMARKS,

MUHAMMAD.VOUDETAIL.ENTTYPE,

MUHAMMAD.VOUDETAIL.DETAILDATE

FROM MUHAMMAD.VOUDETAIL

WHERE MUHAMMAD.VOUDETAIL.ACCID = ?

how i pass my listbox value in where section

here

WHERE MUHAMMAD.VOUDETAIL.ACCID = ?

can i use any textfield or variable in where section

please give me idea

thank's

aamir

[861 byte] By [mfa786a] at [2007-11-27 2:41:38]
# 1
Hi There,The following tutorial will show you exactly how http://developers.sun.com/jscreator/learning/tutorials/2/inserts_updates_delete s.htmlnote how the bottom table is populated using the selected value in top dropdown list.Hope it helpsK
kish@suna at 2007-7-12 3:05:38 > top of Java-index,Development Tools,Java Tools...
# 2

thank's for your reply

sir this sample support only derby database that have integer datatype

sir i want to use the oracle10g that have number datatype when i open that table in Sun Java Studio Creator that show this type dicimal not show number

some body give me idea i use this code for passing query

try {

getSessionBean1().getMfadetailRowSet().setObject(1, new Integer(tt.getValue().toString()));

}

catch(java.sql.SQLException sqle) {

//some exception's handler

}

but when i use this code then no compilation error but jsp page give me in browser like this

======

===========

Exception Details: java.lang.ClassCastException

java.math.BigDecimal

Possible Source of Error:

Class Name: biss.Page1

File Name: Page1.java

Method Name: button1_action

Line Number: 450

Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.

Stack Trace:

biss.Page1.button1_action(Page1.java:450)

sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

Exception Details: javax.faces.el.EvaluationException

java.lang.ClassCastException: java.math.BigDecimal

Possible Source of Error:

Class Name: com.sun.faces.el.MethodBindingImpl

File Name: MethodBindingImpl.java

Method Name: invoke

Line Number: 130

Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.

Stack Trace:

com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)

com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.j ava:72)

com.sun.rave.web.ui.appbase.faces.ActionListenerImpl.processAction(ActionListen erImpl.java:57)

javax.faces.component.UICommand.broadcast(UICommand.java:312)

-

Exception Details: javax.faces.FacesException

#{Page1.button1_action}: javax.faces.el.EvaluationException: java.lang.ClassCastException: java.math.BigDecimal

Possible Source of Error:

Class Name: com.sun.faces.application.ActionListenerImpl

File Name: ActionListenerImpl.java

Method Name: processAction

Line Number: 78

Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.

Stack Trace:

com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.j ava:78)

com.sun.rave.web.ui.appbase.faces.ActionListenerImpl.processAction(ActionListen erImpl.java:57)

javax.faces.component.UICommand.broadcast(UICommand.java:312)

-

Exception Details: com.sun.rave.web.ui.appbase.ApplicationException

#{Page1.button1_action}: javax.faces.el.EvaluationException: java.lang.ClassCastException: java.math.BigDecimal

Possible Source of Error:

Class Name: com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl

File Name: ViewHandlerImpl.java

Method Name: destroy

Line Number: 601

Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.

Stack Trace:

com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.destroy(ViewHandlerImpl.java: 601)

com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.ja va:302)

see all error in jsp page how i solve

=========

sir i want pass any type of variable either string ,number,integer ,decimal char

such as my user inter data through textbox ,listbox,checkbox,radiobutton and other

i replace in variable and pass that varaible ot it can be one,tow ,three or may

first

how i convert my textbox,checkbox,listbox value in string ,integer or other variable

please give me idea how i convert my textbox to string,integer and how pass that variable in sessionbeans query as parameter

i am fasing many problem i want to prove to my boss the java is best in web applicatin and java give full support and best solution

thank' s

aamir

mfa786a at 2007-7-12 3:05:38 > top of Java-index,Development Tools,Java Tools...