Solved

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

Posted on 2009-07-02
2
426 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
Comment Utility
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
Comment Utility
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 Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
constructor overloading 2 73
own marker interface 1 43
maven set up 2 104
withoutString  challenge 40 145
HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
Find out what Office 365 Transport Rules are, how they work and their limitations managing Office 365 signatures.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

10 Experts available now in Live!

Get 1:1 Help Now