Win a copy of Securing DevOps this week in the Security forum!

shravan nitta

Greenhorn
+ Follow
since Sep 27, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by shravan nitta

Hello Prasad,
Instead of writing another method in Java Bean it won't work...Declare one String variable and write getter and setter methods for it.Now Append Your JDBC Code in Setter method.
Try the shown below code as it is your doubts will clarify...

package info.tech;
import java.sql.*;
public class EmployeeJavaBean {
String ename;
String desg;
String storeData;
public void setStoreData(String storeData) {
//JDBC code to store data
}
public String getStoreData(){
return storeData;
}
public String getEname() {
return ename;
}
public void setEname(String ename) {
this.ename = ename;
}
public String getDesg() {
return desg;
}
public void setDesg(String desg) {
this.desg = desg;
}
}
-------@@@@-----
JSP Page
---------
<jsp:useBean id="empobj" class="info.tech.EmployeeJavaBean"></jsp:useBean>
<jsp:setProperty name="empobj" property="ename"/>
<jsp:setProperty name="empobj" property="desg"/>
<jsp:setProperty name="empobj" property="storeData" value="xyz"/>
---------
5 years ago
JSP