Solved

How Do I Pass  MySeq.NEXTVAL (value to jsp Tag)

Posted on 2009-07-02
2
431 Views
Last Modified: 2012-05-07
Request
          I was hoping that someone could assist with what I think is a pretty easy problem to solve but for me has proved to be pretty tricky. I would like to return the NEXTVAL of a sequence to my field labeled PK3.

Accomplishments
I am able to generate nextval of a sequence ("select MySeq.NEXTVAL FROM dual"); as shown in the preparedstatement found below

Question:
When user selects form, How do I automatically return the nextval of my sequence (preparedstatement) to an html field labeled PK3?

My Attempts
I have tried every combination of coding, to return nextval to field PK3 except the one that works.  I can say this, the preparedstatement does work.  It does select nextval for MySeq but I cannot seem to be able to pass the value to the field labeled PK3
<%

Driver DriverRecordset1 = (Driver)Class.forName(MM_conn_CFOB_oracle_DRIVER).newInstance();

Connection ConnRecordset1 = DriverManager.getConnection(MM_conn_CFOB_oracle_STRING,MM_conn_CFOB_oracle_USERNAME,MM_conn_CFOB_oracle_PASSWORD);

PreparedStatement StatementRecordset1 = ConnRecordset1.prepareStatement("select MySeq.NEXTVAL FROM dual");

ResultSet Recordset1 = StatementRecordset1.executeQuery();

Object Recordset1_data;

int Recordset1_numRows = 0;

%>
 
 

<tr>

<td align="left" class="faxtext">PASS Nextval using JSP <input name="PK3" type="text" id="PK3" Value=<%=need code %>

</td></tr>

Open in new window

0
Comment
Question by:rg20
2 Comments
 
LVL 13

Accepted Solution

by:
Murali Murugesan earned 500 total points
ID: 24769405
try this,

<td align="left" class="faxtext">PASS Nextval using JSP <input name="PK3" type="text" id="PK3" Value=<%if(Recordset1.next()){out.println(Recordset1.getInt(1);} %>


0
 
LVL 9

Author Comment

by:rg20
ID: 24769554
Very good with the couple of small codding errors such as end html tag and a parethisis. code works as follows:

<td align="left" class="faxtext">PASS Nextval using JSP
<input name="PK3" type="text" id="PK3" Value=<%if(Recordset1.next()){out.println(Recordset1.getInt(1));} %>>

Thank you!!!!!! I have been working on this for four weeks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

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

Question has a verified solution.

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

When we talk about DevOps toolchains, I sometimes wonder how many people really get what we’re talking about. I don’t know if it’s just semantics or tone or something else, but sometimes I think it just sounds like buzzword sausage. So it’s always …
An analysis of the phishing scam that has been affecting Google users, along with steps to take for protection, as well as what to do if you receive one of the emails.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now