How to return two parameter
hi is it possible to return more than one paremeter in the method,how can i return the pass parameter in the following method
hi is it possible to return more than one paremeter in the method,how can i return the pass parameter in the following method
public String performNewPwd(String pwd,String newPwd,String usrid ){
callPerformSdmsLogon("SMS_FORM_TO_ADf.perform_sdms_new_password(?,?,?)",new Object[] { pwd,newPwd,usrid });
return usrid;
}
how can i Creates a JavaBean to hold the multiple return values or put the desired values together in object of a class you define to hold them., my class is
import java.sql.PreparedStatement;
import java.sql.SQLException;
import oracle.jbo.JboException;
import oracle.jbo.server.ApplicationModuleImpl;
import oracle.jbo.server.ViewLinkImpl;
import oracle.jbo.server.ViewObjectImpl;
import sms0000.common.sms0000AppModule;
public class sms0000AppModuleImpl extends ApplicationModuleImpl implements sms0000AppModule {
public sms0000AppModuleImpl() {
protected void callPerformSdmsLogon(String stmt, Object[] bindVars) {
PreparedStatement st;
st = null;
try {
// 1. Create a JDBC PreparedStatement for
st = getDBTransaction().createPreparedStatement("begin " + stmt + ";end;", 0);
if (bindVars != null) {
// 2. Loop over values for the bind variables passed in, if any
for (int z = 0; z < bindVars.length; z++) {
// 3. Set the value of each bind variable in the statement
st.setObject(z + 1, bindVars[z]);
// 4. Execute the statement
st.executeUpdate();
} catch (SQLException e) {
throw new JboException(e);
} finally {
if (st != null) {
try {
// 5. Close the statement
st.close();
} catch (SQLException e) {
public String PerformSdmsLogon(String userid, String upwd) {
i what to hold the userid,pwd in java bean and return than
callPerformSdmsLogon("SMS_FORM_TO_ADf.perform_sdms_logon(?,?)", new Object[] { userid, upwd, });
return "sms0000-v2";
}Edited by: Tshifhiwa on 2012/05/29 1:30 PM
Similar Messages
-
How to return two XML result sets using the function
Hi Experts,
Thanks.So that I want to return two XML result sets if the query returns more than 50,000 records.
One XML result set with 50,000 and another XML result set with remaining records.
How to incorporate this in my function.
Have the function return a collection of CLOB then.
DBMS_XMLGEN can handle pagination so it's easy to adapt your existing code.
Here's an example fetching data in batches of max. 3 rows each, using a pipelined function :
SQL> create or replace type clob_array is table of clob;
2 /
Type created
SQL>
SQL> create or replace function genXmlRowset (p_deptno in number) return clob_array pipelined
2 is
3 ctx dbms_xmlgen.ctxHandle;
4 doc clob;
5 begin
6
7 ctx := dbms_xmlgen.newContext('SELECT empno, ename FROM scott.emp WHERE deptno = :1');
8 dbms_xmlgen.setBindValue(ctx, '1', p_deptno);
9 dbms_xmlgen.setMaxRows(ctx, 3);
10
11 loop
12
13 doc := dbms_xmlgen.getXML(ctx);
14 exit when dbms_xmlgen.getNumRowsProcessed(ctx) = 0;
15 pipe row (doc);
16
17 end loop;
18
19 dbms_xmlgen.closeContext(ctx);
20
21 return;
22
23 end;
24 /
Function created
SQL> set long 5000
SQL> select * from table(genXmlRowset(30));
COLUMN_VALUE
<?xml version="1.0"?>
<ROWSET>
<ROW>
<EMPNO>7499</EMPNO>
<ENAME>ALLEN</ENAME>
</ROW>
<ROW>
<EMPNO>7521</EMPNO>
<ENAME>WARD</ENAME>
</ROW>
<ROW>
<EMPNO>7654</EMPNO>
<ENAME>MARTIN</ENAME>
</ROW>
</ROWSET>
<?xml version="1.0"?>
<ROWSET>
<ROW>
<EMPNO>7698</EMPNO>
<ENAME>BLAKE</ENAME>
</ROW>
<ROW>
<EMPNO>7844</EMPNO>
<ENAME>TURNER</ENAME>
</ROW>
<ROW>
<EMPNO>7900</EMPNO>
<ENAME>JAMES</ENAME>
</ROW>
</ROWSET>
SQL>
(and don't forget to use bind variables in your query) -
Hi All,
web.show_document('http://127.0.0.1:8889/forms/frmservlet?
form=C:\test_report\final_to_be_added_to_main\MASTER_FORM_TRIAL.fmx&userid=&buffer_records=NO&debug_me
ssages=NO&array=YES&query_only=NO&quiet=NO&RENDER=YES&otherparams=USER_ID=' || :BLOCK3.curr_USER);* here in this code i have pass one parameter from one form to other if i pass two parameter please correct the syntax*
Thanks And Regards
Vikasweb.show_document('http://127.0.0.1:8889/forms/frmservlet?form=C:\test_report\final_to_be_added_to_main\MASTER_FORM_TRIAL.fmx&userid=&buffer_records=NO&debug_messages=NO&array=YES&query_only=NO&quiet=NO&RENDER=YES&otherparams=USER_ID=' || :BLOCK3.curr_USER||'&COMPANY_NAME='||'Blnk');Not working please correct it
Thanks And Regards
Vikas -
I have two parameters on selection screen .
P_QTR and P_YEAR
I have concatenated the Quarter and Year Value to give same f4 on both paramatersto give f4 using 'F4IF_INT_TABLE_VALUE_REQUEST'
for example Q1 2014
now when user selects one value i want to set Q1 to P_QTR and 2014 to P_YEAR.
but it is setting only one value for P_QTR correctly and the value for P_year is not coming on screen although the value is thier inside code in P_year
i am using same f4 for both events
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_qtr.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_year.
here is the code i am using
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CHAR20'
window_title = text-026
value_org = 'S'
TABLES
value_tab = mt_input_f4
return_tab = mt_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
CLEAR mt_input_f4[].
ENDIF.
READ TABLE mt_return INTO ms_return INDEX 1.
IF sy-subrc EQ 0.
p_qtr = ms_return-fieldval+0(2).
p_year = ms_return-fieldval+3(4) .
ENDIF.
plz chk attached picsi am sorry for delayed update but i fixed it using following approach.
READ TABLE mt_return INTO ms_return INDEX 1.
IF sy-subrc EQ 0.
ls_dynpread-fieldname = 'P_QTR'.
ls_dynpread-fieldvalue = ms_return-fieldval+0(2).
APPEND ls_dynpread TO lt_dynpread.
ls_dynpread-fieldname = 'P_YEAR'.
ls_dynpread-fieldvalue = ms_return-fieldval+3(4).
APPEND ls_dynpread TO lt_dynpread.
**setting the selection screen values
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-repid
dynumb = '1000'
TABLES
dynpfields = lt_dynpread
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
CLEAR lt_dynpread[].
ENDIF. -
How to merge two parameter value in WebI
Hi Experts,
I am using Business Object Edge 3.1 sever & MySQL data base.
Question 1:
I have six date field in my universe and one catergory field.
All dates are used for different purpose.
Ex. I have current account opening & Closing date, Money Market Account Opening & Closing Date and say loan account opening & closing date.
I want to count my no. of Opening account & Closing account according to Category.
So in prompt suppose i am giving date like 5/25/2010 to 5/26/2010, so my report should fetch all the account lying in this range.
In short i want only one prompt and i want restrict my all date field with this prompt value.
Question 2:
Can I add my MySQL query in WebI or Universe like "Add Command" in Crystal Report?
Your answer will be appreciated.
Thanks in advance,
RishitIf you give the same "prompt" text for all your prompts/parameters then it will prompt only once. So that's how you can merge the parameters.
The add command is not available. But following workaround may work for you:
Create a query from one of the universe with let's say 3 objects. Now click on the SQL button to view the sql statement. and choose the option for custom sql there. Paste your new SQL ther and save. Just ensure that the number of columns in the SELECT statment mathches with the number of of objects. (3 in this example) and ensure that the data type of the columns and slected objects are matching. I have seen this working, but not gone into very detail.
Anil -
Hi,
How do I return two values from a
stored procedure into an "Execute SQL Task" please? Each of these two values need to be populated into an SSIS variable for later processing, e.g. StartDate and EndDate.
Thinking about stored procedure output parameters for example. Is there anything special I need to bear in mind to ensure that the SSIS variables are populated with the updated stored procedure output parameter values?
Something like ?
CREATE PROCEDURE [etl].[ConvertPeriodToStartAndEndDate]
@intPeriod INT,
@strPeriod_Length NVARCHAR(1),
@dtStart NVARCHAR(8) OUTPUT,
@dtEnd NVARCHAR(8) OUTPUT
AS
then within the SSIS component; -
Kind Regards,
Kieran.
Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/Below execute statement should work along the parameter mapping which you have provided. Also try specifying the parameter size property as default.
Exec [etl].[ConvertPeriodToStartAndEndDate] ?,?,? output, ? output
Add a script task to check ssis variables values using,
Msgbox(Dts.Variables("User::strExtractStartDate").Value)
Do not forget to add the property "readOnlyVariables" as strExtractStartDate variable to check for only one variable.
Regards, RSingh -
Issue with IN parameter of Oracle Procedure returning two RefCursors...
Hi all,
I'm having a nightmare with an Oracle procedure that takes one input parameter and returns two RefCursors as outputs. I recently got help in this forum getting a procedure to work that took no inputs but returned two refcursors and that's still working fine. So, for my current issue I have a procedure defined as follows:
PROCEDURE getQueueInfo(domainKey char, importQueues OUT ODPNet.refcur, exportQueues OUT ODPNet.refcur) IS
BEGIN
OPEN importQueues FOR SELECT
source_key, source_applid,
import_status(source_key) as status,
time_added, time_processed
FROM wm_import_source_header
WHERE source_id = domainKey
ORDER BY source_key DESC;
OPEN exportQueues FOR SELECT
h.source_key, d.source_applid,
export_status(h.source_key) as status,
d.source_wire_code, d.destination_wire_code, h.time_added,
h.time_transmitted
FROM wm_export_source_header h, wm_export_source_data d
WHERE h.source_key = d.source_key
and d.source_id = domainKey
ORDER BY h.source_key DESC;
END getQueueInfo;This is defined within a package called ODPNet as with my previous procedure and all works fine (I can execute within Oracle SQL Developer and it returns the expected results). Within my .NET application my code is as follows:
try
using (OracleConnection conn = new OracleConnection(connString))
using (OracleCommand comm = new OracleCommand())
comm.CommandText = "ODPNet.getQueueInfo";
comm.CommandType = CommandType.StoredProcedure;
comm.Connection = conn;
OracleParameter domainKey = new OracleParameter();
OracleParameter importQueues = new OracleParameter();
OracleParameter exportQueues = new OracleParameter();
domainKey.OracleDbType = OracleDbType.Char;
importQueues.OracleDbType = OracleDbType.RefCursor;
exportQueues.OracleDbType = OracleDbType.RefCursor;
domainKey.Value = "UKBD72";
domainKey.Direction = ParameterDirection.Input;
importQueues.Direction = ParameterDirection.Output;
exportQueues.Direction = ParameterDirection.Output;
comm.Parameters.Add(domainKey);
comm.Parameters.Add(importQueues);
comm.Parameters.Add(exportQueues);
conn.Open();
comm.ExecuteNonQuery();
OracleDataReader dr1 = ((OracleRefCursor)importQueues.Value).GetDataReader();
OracleDataReader dr2 = ((OracleRefCursor)exportQueues.Value).GetDataReader();
if (dr1.HasRows)
while (dr1.Read())
result6 += dr1["source_applid"].ToString() + "<br>";
else
result6 += "No Rows";
if (dr2.HasRows)
while (dr2.Read())
result7 += dr2["source_applid"].ToString() + "<br>";
else
result7 += "No Rows";
catch (Exception ex)
result6 = ex.ToString();
}The value I want to submit as the IN parameter of the procedure is "UKBD72". but I'm really not sure how to apply this and then return my two refcursors into separate datareaders (except for the input parameter stuff the code above is exactly what I did with the other procedure that returned two ref cursors and still works fine). When I run this code I get no errors, I just get told that each DataReader has no rows returned, which shouldn't be right.
Any help with this would be hugely appreciated.
Cheers,
SebSorry folks, after staring at this over and over, eventually going to sleep and coming back to it with some fresh eyes I realised I was just being a complete idiot - I was feeding the procedure different data in the .NET app than I was when testing in Oracle SQL Developer. Low and behold once I gave it the right data it worked!
Silly me... -
How can i make calculation in two file using two parameter
how can i make calculation in two file using two parameter
Solved!
Go to Solution.i am having two differnt file, both file having no and time , i want to make programme that when, number and tiome is same in both file give that index onle in , i am going to attached the file
Attachments:
iisc11-jan2010extract.txt 1253 KB
sp3.xlsx 12 KB -
How to call a procedure which returns out parameter in form personalization
Dear All,
I have one procedure which is having 2 parameter in and one parameter out .
The question is how to get the parameter out in from personalization in a local or global variable?
ThanksYes.
You can use the "forms_ddl" builtin
See the following examples. Make sure you include the single quotes as well as the = sign in the begining.
See http://phenix.blog.163.com/blog/static/8397219320096213953151/
http://oracle.anilpassi.com/forms-personalizations.html
Sandeep Gandhi -
How to get a parameter without name in JSP?
hi everyone, My question is how to get a parameter without name in JSP? I have two pages, 1.html and 2.jsp.
in 1.html, I embeds some Javascript codes in HTML contents like below ( changed < to ( , > to )):
function toSubWin( obj )
window.open('test.jsp?'+obj.firstChild.toString(),'sw');
(a onClick='toSubWin(this)'style="background:green")focus(/a)
How can I get the parameter in 2.jsp?
THANK YOU IN ADVANCE!!Does obj.firstChild.toString() evaluate to a "name=value" type of String ?
Or better what does obj.firstChild.toString(),'sw' evaluate to ? It has to end up in a name=value format, else its just gibberish appended to the url.
In the jsp, you have to obviously know the name to get the parameter. There's a getParameterNames() method which returns you a Collection of parameter names as Strings, you could probably use that to retrieve the param values.
Then there's a getParameterMap() method which returns an immutable Map containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array.
However to what ends you employ them in a program which doesnt know its inputs is a different story.
cheers,
ram. -
FEBA - How to post two or more transactions at the same time?
Hi,
one of our banks sends the statemets with many lines that belongs to the same transaction. We have to post partially one line, and afterwards the other line. Any of you know how to post two lines at the same time from the bank statement?
Thank you in advance,
MiguelHi,
I'm sorry for replying so late.
The solution I reached was to change the a few things in the standard.
Now I have a new "context menu item". I select two or more transactions and I right-click the mouse. I select that "context menu item" and the next part of the code adds the total amount of the transactions to look for the correct post for the first transaction. Once posted automatically, the next transaction is posted automatically by the system.
I hope you understand my English. I've problem with technical FI terms.
Here you are the code:
First I added a new contextual menu item:
CL_FEBAN_ALV_GRID=============CCIMP
call method e_object->add_function
EXPORTING
fcode = 'BS_POST_ITEMS'
text = text-002.
*{ INSERT DHTK904078 1
*--> Miguel Estu00E9vez - 16/06/2008
* RIPI 24/04/2008 - Conciliaciones
* Permitir conciliar mu00E1s de un apunte a la vez
call method e_object->add_function
EXPORTING
fcode = 'ZBS_POST_ITEMS'
text = text-Z02.
*<-- Miguel Estu00E9vez - 16/06/2008
*} INSERT
call method e_object->add_function
EXPORTING
fcode = 'BS_KILL_ADVICE'
text = text-004.
CL_FEBAN_ALV_GRID=============CCIMP
when 'BS_POST_ITEMS'.
call method cl_feban_propagator=>raise_event
EXPORTING
i_event = 'POST_ITEMS'
i_ref_to_item = l_ref_to_item.
*{ INSERT DHTK904078 2
*--> Miguel Estu00E9vez - 16/06/2008
* RIPI 24/04/2008 - Conciliaciones
* Permitir conciliar mu00E1s de un apunte a la vez
when 'ZBS_POST_ITEMS'.
call method cl_feban_propagator=>raise_event
EXPORTING
i_event = 'ZPOST_ITEMS'
i_ref_to_item = l_ref_to_item.
*<-- Miguel Estu00E9vez - 16/06/2008
*} INSERT
when 'BS_LOCK_ITEMS'.
call method cl_feban_propagator=>raise_event
EXPORTING
i_event = 'LOCK_ITEMS'
i_ref_to_item = l_ref_to_item.
CL_FEBAN_PROPAGATOR===========CM001
when 'POST_ITEMS'.
raise event post_items
exporting i_ref_to_item = i_ref_to_item.
*{ INSERT DHTK904078 1
*--> Miguel Estu00E9vez - 16/06/2008
* RIPI 24/04/2008 - Conciliaciones
* Permitir conciliar mu00E1s de un apunte a la vez
when 'ZPOST_ITEMS'.
data: zvalor(1) value '' .
export zvalor from 'X' to memory ID 'ZFEBA01'.
raise event post_items
exporting i_ref_to_item = i_ref_to_item.
*<-- Miguel Estu00E9vez - 16/06/2008
*} INSERT
when 'LOCK_ITEMS'.
raise event lock_items
exporting i_ref_to_item = i_ref_to_item.
Now, I proceed to calculate the total amount of the selected transactions to look for the correct one to post.
LNEW_FEBAF01
* user parameter
l_feban_position type c.
field-symbols: <items> type item_tab_type.
*{ INSERT DHTK904077 1
*--> Miguel Estu00E9vez - 16/06/2008
* RIPI 24/04/2008 - Conciliaciones
* Permitir conciliar mu00E1s de un apunte a la vez
data: zvalor(1) value '',
zkwbtr type kwbtr,
kwb type kwbtr.
import zvalor to zvalor from memory ID 'ZFEBA01'.
if ( zvalor is not initial ).
if not i_ref_to_item is initial.
assign i_ref_to_item->* to <items>.
loop at <items> into h_item.
select single kwbtr
into kwb
from febep
where kukey = h_item-kukey and
esnum = h_item-esnum.
zkwbtr = zkwbtr + kwb.
endloop.
endif.
export zkwbtr from zkwbtr to memory ID 'ZKWBTR'.
endif.
*<-- Miguel Estu00E9vez - 16/06/2008
*} INSERT
refresh g_picked_items.
if not i_ref_to_item is initial.
assign i_ref_to_item->* to <items>.
loop at <items> into h_item.
move-corresponding h_item to h_picked_items.
append h_picked_items to g_picked_items.
endloop.
endif.
submit rfebbu00 and return
user sy-uname
with anwnd = r_doc->*-anwnd
with s_kukey in s_kukey
with s_esnum in s_esnum
with buber = g_posting_area
with mregel = '1'
with function = 'C'
with mode = g_mode
with p_bupro = g_bupro.
*{ INSERT DHTK904077 2
*--> Miguel Estu00E9vez - 17/06/2008
* RIPI 24/04/2008 - Conciliaciones
* Permitir conciliar mu00E1s de un apunte a la vez
if ( zkwbtr is not initial ).
select single kwbtr
into kwb
from febep
where kukey = h_kukey-low and
esnum = h_esnum-low.
zkwbtr = zkwbtr - kwb.
export zkwbtr from zkwbtr to memory ID 'ZKWBTR'.
endif.
*<-- Miguel Estu00E9vez - 17/06/2008
*} INSERT
refresh s_kukey.
refresh s_esnum.
clear h_kukey.
clear h_esnum.
endloop. "loop over all picked items
call function 'CUSTOMIZED_MESSAGE'
EXPORTING
i_arbgb = 'NEW_FEBA'
i_dtype = '-'
i_msgnr = '110'.
RFEBBU00
* original transaction currency provided and posting area = 2.
ftclear-selvon = febep-fwbtr. "INSERT - mpEURO
ENDIF. "INSERT - mpEURO
CONDENSE ftclear-selvon NO-GAPS.
*{ INSERT DHTK903977 1
*--> Miguel Estu00E9vez - 16/06/2008
* RIPI 24/04/2008 - Conciliaciones
* Permitir conciliar mu00E1s de un apunte a la vez
data: zkwbtr type kwbtr.
import zkwbtr to zkwbtr from memory ID 'ZKWBTR'.
if ( zkwbtr is not initial ).
ftclear-selvon = zkwbtr.
clear zkwbtr.
endif.
*<-- Miguel Estu00E9vez - 16/06/2008
*} INSERT
APPEND ftclear.
** Begin of comment C5053248
* perform druck_buzei_ftclear using ftclear-agkon. -
Need Help-How Store the input parameter through java bean
Hello Sir,
I have a simple Issue but It is not resolve by me i.e input parameter
are not store in Ms-Access.
I store the input parameter through Standard Action <jsp:useBean>.
jsp:useBean call a property IssueData. this property exist in
SimpleBean which create a connection from DB and insert the data.
At run time servlet and server also show that loggging are saved in DB.
But when I open the table in Access. Its empty.
Ms-Access have two fields- User, Password both are text type.
Please review these code:
login.html:
<html>
<head>
<title>A simple JSP application</title>
<head>
<body>
<form method="get" action="tmp" >
Name: <input type="text" name="user">
Password: <input type="password" name="pass">
<input type="Submit" value="Submit">
</form>
</body>
</html>LoginServlet.java:
import javax.servlet.*;
import javax.servlet.http.*;
public class LoginServlet extends HttpServlet{
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException{
try
String user=request.getParameter("user");
String pass=request.getParameter("pass");
co.SimpleBean st = new co.SimpleBean();
st.setUserName(user);
st.setPassword(pass);
request.setAttribute("user",st);
request.setAttribute("pass",st);
RequestDispatcher dispatcher1 =request.getRequestDispatcher("submit.jsp");
dispatcher1.forward(request,response);
catch(Exception e)
e.printStackTrace();
}SimpleBean.java:
package co;
import java.util.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.util.*;
public class SimpleBean {
private String user="";
private String pass="";
private String s="";
public String getUserName() {
return user;
public void setUserName(String user) {
this.user = user;
public String getPassword() {
return pass;
public void setPassword(String pass) {
this.pass = pass;
public String getIssueData() //method that create connection with database
try
System.out.println("Printed*************************************************************");
getUserName();
getPassword();
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
System.out.println("Loading....");
Connection con=DriverManager.getConnection("jdbc:odbc:simple");
System.out.println("Connected....");
PreparedStatement st=con.prepareStatement("insert into Table1 values(?,?)");
System.out.println("~~~~~~~~~~~~~~~~~~~~");
String User=getUserName();
st.setString(1,User);
String Password=getPassword();
st.setString(2,Password);
st.executeUpdate();
System.out.println("Query Executed");
con.close();
s= "Your logging is saved in DB ";
System.out.println("Your logging is saved in DB *****************");
return(s);
catch(Exception e)
e.printStackTrace();
return "failed";
}submit.jsp:
This is Submit page
<html><body>
Hello
Student Name: <%= ((co.SimpleBean)request.getAttribute("user")).getUserName() %>
<br>
Password: <%= ((co.SimpleBean)request.getAttribute("pass")).getPassword() %>
<br>
<jsp:useBean id="st" class="co.SimpleBean" scope="request" />
<jsp:getProperty name="st" property="IssueData" />
</body></html>web.xml:<web-app>
<servlet>
<servlet-name>one</servlet-name>
<servlet-class>LoginServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>one</servlet-name>
<url-pattern>/tmp</url-pattern>
</servlet-mapping>
<jsp-file>issue.jsp</jsp-file>
<jsp-file>submit.jsp</jsp-file>
<url-pattern>*.do</url-pattern>
<welcome-file-list>
<welcome-file>Login.html</welcome-file>
</welcome-file-list>
</web-app>Please Help me..Thanks.!!!
--Dear Sir,
Same issue is still persist. Input parameter are not store in database.
After follow your suggestion when I run this program browser show that:i.e
This is Submit page Hello Student Name: vijay
Password: kumar
<jsp:setProperty name="st" property="userName" value="userValue/> Your logging is saved in DB
Please review my code.
login.html:
{code}<html>
<head>
<title>A simple JSP application</title>
<head>
<body>
<form method="get" action="tmp" >
Name: <input type="text" name="user">
Password: <input type="password" name="pass">
<input type="Submit" value="Submit">
</form>
</body>
</html>{code}
LoginServlet.java:
{code}import javax.servlet.*;
import javax.servlet.http.*;
public class LoginServlet extends HttpServlet{
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException{
try
String userValue=request.getParameter("user");
String passValue=request.getParameter("pass");
co.SimpleBean st = new co.SimpleBean();
st.setuserName(userValue);
st.setpassword(passValue);
request.setAttribute("userValue",st);
request.setAttribute("passValue",st);
RequestDispatcher dispatcher1 =request.getRequestDispatcher("submit.jsp");
dispatcher1.forward(request,response);
catch(Exception e)
e.printStackTrace();
}{code}
SimpleBean.java:
{code}package co;
import java.util.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.util.*;
public class SimpleBean {
private String userValue="";
private String passValue="";
private String s="";
public String getuserName() {
return userValue;
public void setuserName(String userValue) {
this.userValue = userValue;
public String getpassword() {
return passValue;
public void setpassword(String passValue) {
this.passValue= passValue ;
public String getissueData() //method that create connection with database
try
System.out.println("Printed*************************************************************");
getuserName();
getpassword();
Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("Connection loaded");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@VijayKumar-PC:1521:XE","SYSTEM","SYSTEM");
System.out.println("Connection created");
PreparedStatement st=con.prepareStatement("insert into vij values(?,?)");
System.out.println("~~~~~~~~~~~~~~~~~~~~");
String userName=getuserName();
st.setString(1,userName);
String password=getpassword();
st.setString(2,password);
st.executeUpdate();
System.out.println("Query Executed");
con.close();
s= "Your logging is saved in DB ";
System.out.println("Your logging is saved in DB *****************");
return(s);
catch(Exception e)
e.printStackTrace();
return "failed";
}{code}
submit.jsp:
{code}This is Submit page
<html><body>
Hello
Student Name: <%= ((co.SimpleBean)request.getAttribute("userValue")).getuserName() %>
<br>
Password: <%= ((co.SimpleBean)request.getAttribute("passValue")).getpassword() %>
<br>
<jsp:useBean id="st" class="co.SimpleBean" scope="request" />
<jsp:setProperty name="st" property="userName" value="userValue/>
<jsp:setProperty name="st" property="password" value="passValue"/>
<jsp:getProperty name="st" property="issueData" />
</body></html>web.xml:<web-app>
<servlet>
<servlet-name>one</servlet-name>
<servlet-class>LoginServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>one</servlet-name>
<url-pattern>/tmp</url-pattern>
</servlet-mapping>
<jsp-file>submit.jsp</jsp-file>
<url-pattern>*.do</url-pattern>
<welcome-file-list>
<welcome-file>Login.html</welcome-file>
</welcome-file-list>
</web-app>Sir I can't use EL code in jsp because I use weblogic 8.1 Application Server.This version are not supported to EL.
Please help me...How store th input parameter in Database through Java Bean -
How to return the name (or ID) of the Task FLow in Script
Sitaution; two task flows created which can be accessed via Tools > TaskFlows within FDQM
Task Flow "1.1 Multi Load - Import" --> Should run Batch Process Up to Import (enmBatchProcessLevel: 2)
Task Flow "2.1 Multi Load - Import Up To Validate" --> Should run Batch Process Up to Validate (enmBatchProcessLevel: 4)
I have developed one generic script which I would like to use for each task flow.
Only the enmBatchProcessLevel differs between the task flows and therefore I would like to parse this enmBatchProcessLevel as a parameter my generic script.
To be able to do this, the script needs to know on which task flow a user has clicked. So, I am looking for a function or statement which returns the name (or ID) of the task flow. Based on this name (or ID) a conditional statement can be performed in which a variable is dynamically filled. This variable can then be parsed as a parameter to my generic script.
For instance:
Sub GenericRoutine
Dim strTaskFlow
Dim intBatchProcessLevel
'--Get the Task Flow Name
strTaskFlow = ......<How to return the TaskFlow name or ID?>
'--Validate the task flow and fill variable intBatchProcessLevel dynamically
Select Case strTaskFlow
Case "1.1 Multi Load - Import"
intBatchProcessLevel = 2
Case "2.1 Multi Load - Import Up To Validate"
intBatchProcessLevel = 4
End Select
'--Execute generic script
'--Call Batch script and parse intBatchProcessLevel as a parameter:
Call sBatchProcess(intBatchProcessLevel)
'--Execute generic script
End Sub
Sub sBatchProcess(Byval intBatchProcessLevel)
Dim lngProcessLevel
Dim strDelimiter
Dim blnAutoMapCorrect
'--Use intBatchProcessLevel to fill lngProcessLevel
lngProcessLevel = intBatchProcessLevel
strDelimiter = "_"
blnAutoMapCorrect = 0
Set BATCHENG.PcolFiles = BATCHENG.fFileCollectionCreate(CStr(strDelimiter))
BATCHENG.mFileCollectionProcess BATCHENG.PcolFiles, CLng(lngProcessLevel), , CBool(blnAutoMapCorrect)
End Sub
Edited by: user13642656 on Jul 21, 2011 4:55 AMHi, thanks for your reply.
The Generic script contains 600+ records, which I would like to maintain once, when having multiple Task Flows for Import, UpToValidate, ValidateOnly, UpToExport, ExportOnly etc.
Is there a central storage in FDQM workbench for script, like a "Module" in Excel VisualBasic environment? Thanks! -
Hibernate query...how to connect two databases...
hi i m new to hibernate..
i created two tables..
1st table is catalog:
2nd table is acctinfo
//HBM file is :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="hibernate.example.Catalog" table="catalog">
<id name="id" type="integer" column="ID">
<generator class="increment"/>
</id>
<property name="journal" type="string" column="JOURNAL"/>
<property name="publisher" type="string" column="PUBLISHER"/>
<property name="edition" type="string" column="EDITION"/>
<property name="title" type="string" column="TITLE"/>
<property name="author" type="string" column="AUTHOR"/>
<bag name="accinfo" cascade="all" >
<key column="ID"/>
<one-to-many class="hibernate.example.Acctinfo"/>
</bag>
</class>
<class name="hibernate.example.Acctinfo" table="acctinfo">
<id name="id" type="integer" column="ID">
<generator class="increment"/>
</id>
<property name="account" type="string" column="ACCOUNT"/>
<property name="password" type="string" column="PASSWORD"/>
<property name="balance" type="string" column="BALANCE"/>
</class>
</hibernate-mapping>
///******************getter setter file is::****************
package hibernate.example;
public class Acctinfo
int id;
String account;
String password;
String balance;
public Acctinfo()
public void setId(int id)
this.id = id;
public int getId()
return id;
public void setAccount(String account)
this.account = account;
public void setPassword(String password)
this.password = password;
public void setBalance(String balance)
this.balance = balance;
public String getAccount()
return account;
public String getBalance()
return balance;
public String getPassword()
return password;
//********************2nd getter setter file is:***********************
package hibernate.example;
import java.util.List;
public class Catalog
int id;
String journal;
String publisher;
String edition;
String title;
String author;
private List accinfo;
public Catalog()
public void setId(int id)
this.id = id;
public int getId()
return id;
public void setJournal(String journal)
this.journal = journal;
public String getJournal()
return journal;
public void setPublisher(String publisher)
this.publisher = publisher;
public String getPublisher()
return publisher;
public void setEdition(String edition)
this.edition = edition;
public String getEdition()
return edition;
public void setTitle(String title)
this.title = title;
public String getTitle()
return title;
public void setAuthor(String author)
this.author = author;
public String getAuthor()
return author;
public void setAccinfo(List accinfo)
this.accinfo = accinfo;
public List getAccinfo()
return accinfo;
* To change this template, choose Tools | Templates
* and open the template in the editor.
package hibernate.example;
import hibernate.example.Acctinfo;
import hibernate.example.Catalog;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import org.hibernate.Query;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
public class CatalogClient
Session session = null;
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
public static void main(String str[])
CatalogClient clc = new CatalogClient();
//clc.saveData();
//clc.deleteData();
//clc.showData();
clc.updateData();
public void showData()
try
session =sessionFactory.openSession();
String SQL_QUERY ="select id, journal, publisher, edition, title, author from catalog";
// String SQL_QUERY ="select c.ID, c.JOURNAL, c.PUBLISHER, c.EDITION, c.TITLE, c.AUTHOR, a.ACCOUNT, a.PASSWORD,a.BALANCE from catalog c, ACCTINFO a where c.ID = a.ID";
SQLQuery query = session.createSQLQuery(SQL_QUERY);
System.out.println("*** query : *** "+ query);
//for(ListIterator it=query.list().listIterator();it.hasNext();)
for (ListIterator lit = query.list().listIterator(); lit.hasNext();)
Object[] row = (Object[]) lit.next();
/*System.out.println("ID: " + row[0]);
System.out.println("Title: " + row[1]);
System.out.println("Author: " + row[2]);
System.out.println("Isbn: " + row[3]);
System.out.println("Pages: " + row[4]);
System.out.println("Copyright: " + row[5]);
System.out.println("Cost: " + row[6]);
System.out.println("******NEXT****************");
Object[] row = (Object[]) it.next();*/
System.out.println("ID: " + row[0]);
System.out.println("JOURNAL: " + row[1]);
System.out.println("PUBLISHER: " + row[2]);
System.out.println("EDITION: " + row[3]);
System.out.println("TITLE: " + row[4]);
System.out.println("AUTHOR: " + row[5]);
System.out.println("acc: " + row[6]);
System.out.println("pass: " + row[7]);
System.out.println("bal: " + row[8]);
System.out.println("***************************");
session.close();
catch(Exception e)
System.out.println(e.getMessage());
public void saveData()
session =sessionFactory.openSession();
Transaction transaction = null;
transaction = session.beginTransaction();
Catalog catalog = setBean();
//System.out.println("before save");
session.save(catalog);
//System.out.println("after save");
transaction.commit();
session.flush();
session.close();
public void updateData()
session =sessionFactory.openSession();
Catalog catalog = new Catalog();
catalog.setId(2);
catalog.setAuthor("manoj");
catalog.setJournal("java");
catalog.setEdition("1st");
catalog.setPublisher("indiabulls");
catalog.setTitle("java Servlet");
session.update(catalog);
session.flush();
session.close();
public void deleteData()
session =sessionFactory.openSession();
Catalog catalog = new Catalog();
catalog.setId(3);
session.delete(catalog);
session.flush();
session.close();
public static Catalog setBean()
Acctinfo accinfo = new Acctinfo();
accinfo.setAccount("MANOJ1");
accinfo.setPassword("orbis");
accinfo.setBalance("1000");
List list = new ArrayList();
list.add(accinfo);
Catalog catalog = new Catalog();
catalog.setJournal("india");
catalog.setPublisher("indiabulls");
catalog.setEdition("ist");
catalog.setTitle("orbis");
catalog.setAuthor("manoj");
catalog.setAccinfo(list);
return catalog;
//********************CFG FILE IS ******************
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory name="session">
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@172.16.31.25:1521:BOMBAY</property>
<property name="hibernate.connection.username">mumbai</property>
<property name="hibernate.connection.password">mumbai123</property>
<!-- Set AutoCommit to true -->
<property name="connection.autocommit">true</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<!-- Mapping files -->
<mapping resource="Catalog.hbm.xml"/>
</session-factory>
</hibernate-configuration>
**********************error i m facing is :************************
0 [main] WARN net.sf.ehcache.config.Configurator - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/Documents%20and%20Settings/d.poonam/Desktop/hibernate/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
1188 [main] WARN org.hibernate.impl.SessionFactoryObjectFactory - Could not bind factory to JNDI
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getNameParser(Unknown Source)
at org.hibernate.util.NamingHelper.bind(NamingHelper.java:52)
at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:247)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1043)
at hibernate.example.CatalogClient.<init>(CatalogClient.java:24)
at hibernate.example.CatalogClient.main(CatalogClient.java:27)
please help me out....
thanks in advance..
if u know how to connect two tables plz let me know..
its urgent....I made this work with MySQL. Adapt to your situation as needed. - %
package hibernate.model;
import hibernate.util.HibernateUtils;
import hibernate.model.Catalog;
import hibernate.model.Account;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Session;
import hibernate.util.HibernateUtils;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
public class CatalogTest
private static final Log LOGGER = LogFactory.getLog(CatalogTest.class);
public static void main(String[] args)
Session session = null;
try
session = HibernateUtils.getSessionFactory().getCurrentSession();
session.beginTransaction();
int rowsBefore = HibernateUtils.getRowCount(session, Catalog.class);
assertEquals("should not have any Catalogs", rowsBefore, 0);
Catalog catalog = new Catalog("test title");
catalog.addAccount(new Account(100));
catalog.addAccount(new Account(200));
Long id = (Long) session.save(catalog);
assertNotNull("generated id should not be null", id);
LOGGER.info("returned id: " + id);
session.getTransaction().commit();
LOGGER.debug("transaction committed");
catch (Exception e)
LOGGER.error(e);
session.getTransaction().rollback();
package hibernate.model;
import java.io.Serializable;
import java.text.NumberFormat;
public class Account implements Serializable
private Long id;
private int balance;
public Account()
this(null, 0);
public Account(int balance)
this(null, balance);
public Account(Long id, int balance)
this.id = id;
this.balance = balance;
public Long getId()
return id;
private void setId(Long id)
this.id = id;
public int getBalance()
return balance;
private void setBalance(int balance)
this.balance = balance;
public boolean equals(Object o)
if (this == o)
return true;
if (!(o instanceof Account))
return false;
Account account = (Account) o;
return !(id != null ? !id.equals(account.id) : account.id != null);
public int hashCode()
int result;
result = (id != null ? id.hashCode() : 0);
result = 31 * result + balance;
return result;
public String toString()
return new StringBuilder().append("Account{").append("id=").append(id).append(", balance=").append(NumberFormat.getCurrencyInstance().format(balance)).append('}').toString();
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="hibernate.model" default-access="field" default-lazy="true">
<class name="Account" table="accounts">
<id name="id" column="account_id">
<generator class="native"/>
</id>
<property name="balance" column="balance"/>
</class>
</hibernate-mapping>
package hibernate.model;
import java.io.Serializable;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
public class Catalog implements Serializable
private Long id;
private String title;
private Set<Account> accounts;
public Catalog()
this(null, "", Collections.EMPTY_SET);
public Catalog(String title)
this(null, title, Collections.EMPTY_SET);
public Catalog(Long id, String title, Set<Account> accounts)
this.id = id;
this.title = title;
this.accounts = new HashSet<Account>(accounts);
public Long getId()
return id;
private void setId(Long id)
this.id = id;
public String getTitle()
return title;
private void setTitle(String title)
this.title = title;
public Set<Account> getAccounts()
return accounts;
private void setAccounts(Set<Account> accounts)
this.accounts = accounts;
public void addAccount(Account account)
this.getAccounts().add(account);
public void removeAccount(Account account)
this.getAccounts().remove(account);
public boolean equals(Object o)
if (this == o)
return true;
if (!(o instanceof Catalog))
return false;
Catalog catalog = (Catalog) o;
return !(id != null ? !id.equals(catalog.id) : catalog.id != null);
public int hashCode()
return (id != null ? id.hashCode() : 0);
public String toString()
return new StringBuilder().append("Catalog{").append("id=").append(id).append(", title='").append(title).append('\'').append(", accounts=").append(accounts).append('}').toString();
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="hibernate.model" default-access="field" default-lazy="true">
<class name="Catalog" table="catalogs">
<id name="id" column="catalog_id">
<generator class="native"/>
</id>
<property name="title" column="title"/>
<set name="accounts" cascade="all">
<key column="catalog_id"/>
<one-to-many class="hibernate.model.Account"/>
</set>
</class>
</hibernate-mapping>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/hibernate?autoReconnect=true</property>
<property name="connection.username">hibernate</property>
<property name="connection.password">hibernate</property>
<property name="connection.pool_size">1</property>
<property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
<property name="show_sql">true</property>
<property name="generate_statistics">true</property>
<property name="query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="cache.use_minimal_puts">false</property>
<property name="cache.use_query_cache">false</property>
<property name="order_updates">false</property>
<property name="hbm2ddl.auto">create-drop</property>
<property name="current_session_context_class">thread</property>
<mapping resource="hibernate/persistence/hibernate/Account.hbm.xml"/>
<mapping resource="hibernate/persistence/hibernate/Catalog.hbm.xml"/>
</session-factory>
</hibernate-configuration> -
How to place two checkboxes in a single line.
Hi all,
In selection screen , how we place two checkboxes
with labels in a sigle line.
Regards,
bala.hi,
chk this.
chk this.
SELECTION-SCREEN: BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(3) TEXT-003
FOR FIELD P_Chk1.
SELECTION-SCREEN POSITION 30.
PARAMETER: P_chk1 AS CHECKBOX.
SELECTION-SCREEN POSITION 35.
PARAMETER: P_chk2 AS CHECKBOX.
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN: END OF BLOCK B2.
rgsd
anver
if hlped mark points
Maybe you are looking for
-
Error in MIGO for a subcontracting PO
Hello all, A user is getting an error while doing Goods Receipt (MIGO) for a subcontracting PO (Acct. Asnmt. Cat. "K", Item Cat. "L"). Error says "Fld. select. for mvmt. type 543 / acct.54210234 differs for Network (019)" In Mvmt. type 543, the "Netw
-
NB550D - VGA female to HDMI male adaptor
Hello, I need to connect my Toshiba netbook NB550D to a male VGA cable (this is for projection on screen). I figured I need an VGA female to HDMI male adaptor. However, I am unable to find any. Has anybody faced this problem before? All I was able to
-
Ok I'm running iChat, and my buddy is running iChat. I can see his 3+ telephone and everything. We both just updated to 10.4.4 If i try and start the chat, and he oks it, the says, "connecting" for a bit. Then it stops and say that I didn't respond.
-
Custom Invoice Regulations in Brazil
Hello, Does anyone know if there are special custom regulations in Brazil that require displaying at custom the final customer invoice? I am engaged in a project where we issue a performa/merchandize invoice at the shipping stage and only later send
-
Is there any reason or my why cursor is stuck on the spinning rainbow wheel?
Lately my macbook has been freezing, and I'm thinking that it's being overloaded. Most of the time the cursor is stuck on the spinning rainbow wheel, but it will eventually return back into the arrow. It's currently stuck as the spinning wheel, but I