?
Solved

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

Posted on 2009-07-02
2
Medium Priority
?
446 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
Murali Murugesan earned 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

What's worse than having your data encrypted by ransomware? Getting attacked by a so-called "wiper," which simply destroys the data and offers you no hope of ever seeing it again.
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

801 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