Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-07-02
2
Medium Priority
?
449 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

With the evolution of technology, we have finally reached a point where it is possible to have home automation features like having your thermostat turn up and door lock itself when you leave, as well as a complete home security system. This is a st…
With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

609 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