I have made this edao pkg
package edao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Statement; import ebean.Add_Village; public class AddVillageInfo extends EConnect { Connection con; public boolean save_add(Add_Village ad) { try{ con=getConnection(); Statement st=con.createStatement(); ResultSet rs1=st.executeQuery("select Id from AddVillageDetails"); String temp="1"; while(rs1.next()) { temp=rs1.getString(1); } temp=String.valueOf(Integer.parseInt(temp)+1); PreparedStatement stmt=con.prepareStatement("insert into AddVillageDetails values(?,?,?,?,?,?,?,?,?)"); System.out.println("start"); stmt.setString(1,temp); stmt.setString(2,ad.getState()); stmt.setString(3,ad.getDistrict()); stmt.setString(4,ad.getTehsil()); stmt.setString(5,ad.getVillageName()); stmt.setString(6,ad.getSurpanchName()); stmt.setString(7,ad.getNoOfHouseHolds()); stmt.setString(8,ad.getNoOfLandSellers()); stmt.setString(9,ad.getTotalVillageArea()); System.out.println("Bean set"); stmt.executeUpdate(); return true; } catch(Exception e) { e.printStackTrace(); System.out.println(e); return false; } } } **then i have this ebean pkg** package ebean; public class Add_Village { String Id,State,District,Tehsil,VillageName,SurpanchName,NoOfHouseHolds,NoOfLandSellers,TotalVillageArea; public String getId() { return Id; } public void setId(String id) { Id = id; } public String getState() { return State; } public void setState(String state) { State = state; } public String getDistrict() { return District; } public void setDistrict(String district) { District = district; } public String getTehsil() { return Tehsil; } public void setTehsil(String tehsil) { Tehsil = tehsil; } public String getVillageName() { return VillageName; } public void setVillageName(String villagename) { VillageName = villagename; } public String getSurpanchName() { return SurpanchName; } public void setSurpanchName(String surpanchname) { SurpanchName = surpanchname; } public String getNoOfHouseHolds() { return NoOfHouseHolds; } public void setNoOfHouseHolds(String noofhouseholds) { NoOfHouseHolds = noofhouseholds; } public String getNoOfLandSellers() { return NoOfLandSellers; } public void setNoOfLandSellers(String nooflandsellers) { NoOfLandSellers = nooflandsellers; } public String getTotalVillageArea() { return TotalVillageArea; } public void setTotalVillageArea(String totalvillagearea) { TotalVillageArea = totalvillagearea; } } **how to connect with this edao and ebean pkg with my jsp page** <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <% String state=request.getParameter("state"); String district=request.getParameter("district"); String tehsil=request.getParameter("tehsil"); String villagename=request.getParameter("villagename"); String surpanchname=request.getParameter("surpanchname"); String noofhouseholds=request.getParameter("noofhouseholds"); String nooflandsellers=request.getParameter("nooflandsellers"); String totalvillagearea=request.getParameter("totalvillagearea"); %> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>AddVillagejsp</title> </head> <body bottommargin="2" leftmargin="10" rightmargin="10" topmargin="1"> <table align="center" cellSpacing=0 cellPadding=0 width="60%" border=0> <tbody> <tr> <td bgColor="#2a5865" colSpan=1> <IMG height=4 src="images/zero.gif" width=1> </td> </td> </tbody> </table> <table align="center" width="60%" height="100" > <tr> <td width="40%" height="100"> <p align="right" style="margin-top: 0; margin-bottom: 0"> <img src="images/avantha1.jpg" width="520" height="100"></p> </td> <td width="20%" height="100"> <p align="right" style="margin-top: 0; margin-bottom: 0"> <img src="images/logo[2].gif" width="200" height="100"></p> </td> </tr> </table> <body style="margin-left: 10pt; margin-right: 10pt; margin-bottom: 5pt" > <TD background="images/dot.gif"><IMG height=4 src="images/zero.gif" width=25></TD> </TR></TBODY></TABLE> <br> <table width="60%" height="40" border="0" cellpadding="6" cellspacing="0" align="center"> <tbody> <tr> <td valign="top" align="center" bgcolor="#2a5865"><font class="blackboldtxt"><font color="#ffffff" size=5><b>Add Village Details</b></font></font></td></tr> </td> </tr> <form name="VillageDetailsForm" action="simple.jsp" method="post" onSubmit="return adsvalidate();"> <table width="50%" height="400" bgcolor="#ecf7fb" border="0" cellpadding="0" cellspacing="0" align="center"> <br> <tbody><tr><td colspan="2" align="center"><font class="textsmallbluenormal"><font color="#333333">All fields marked with <font color="#d36000">*</font> are mandatory.</font></font></td></tr> <tr> <td style="padding-left: 15px; padding-top: 10px;" valign="middle" width="200"><font class="blackboldtxt"><font color="#003e7b">State :</font></font> <font class="smalltext"><font color="#d36000">*</font></font></td> <td style="padding-top: 10px;" valign="top"> <select style="width: 175px; font-family: arial,Verdana,sans-serif; font-size: 8pt;" class="textfiled" name="State" onChange="fillSelectFromArray(this.form.City, ((this.selectedIndex == -1) ? null : residingcity[this.selectedIndex-1]));getLocality();"> <option value="0" selected="selected"> ---------- Select State ---------- </option> <option value="1">Chhattisgarh</option> <option value="2">Madhya Pradesh</option> </select> </td> </tr> <tr> <td style="padding-left: 15px; padding-top: 10px;" valign="middle"> <font class="blackboldtxt"><font color="#003e7b">District :</font> <font class="smalltext"><font color="#d36000">*</font></font></font> </td> <td style="padding-top: 10px;" valign="top"> <input class="addtextfiled" size="25" name="District" value=""> </td> </tr> <tr> <td style="padding-left: 15px; padding-top: 10px;" valign="middle"> <font class="blackboldtxt"><font color="#003e7b">Tehsil/Taluka/Block :</font> <font class="smalltext"><font color="#d36000">*</font></font></font> </td> <td style="padding-top: 10px;" valign="top"> <input class="addtextfiled" size="25" name="tehsil" value=""> </td> </tr> <tr> <td style="padding-left: 15px; padding-top: 10px;" valign="middle"> <font class="blackboldtxt"><font color="#003e7b">Village :</font> <font class="smalltext"><font color="#d36000">*</font></font></font> </td> <td style="padding-top: 10px;" valign="top"> <input class="addtextfiled" size="25" name="VillageName" value=""> </td> </tr> <tr> <td style="padding-left: 15px; padding-top: 10px;" valign="middle"> <font class="blackboldtxt"><font color="#003e7b">Surpanch Name :</font></font> <font class="smalltext"><font color="#d36000">*</font></font></td> <td style="padding-top: 10px;" valign="top"> <input class="addtextfiled" size="25" name="SurpanchName" value=""> </td> </tr> <tr> <td style="padding-left: 15px; padding-top: 10px;" valign="middle"> <font class="blackboldtxt"><font color="#003e7b">No. Of HouseHolds :</font></font> <font class="smalltext"><font color="#d36000">*</font></font></td> <td style="padding-top: 10px;" valign="top"> <input class="addtextfiled" size="15" name="NumberOfHouseHolds" value=""> </td> </tr> <tr> <td style="padding-left: 15px; padding-top: 10px;" valign="middle"> <font class="blackboldtxt"><font color="#003e7b">No. Of Land Sellers :</font></font> <font class="smalltext"><font color="#d36000">*</font></font></td> <td style="padding-top: 10px;" valign="top"> <input class="addtextfiled" size="15" name="NumberOfLandLosers" value=""> </td> </tr> <tr> <td style="padding-left: 15px; padding-top: 10px;" valign="middle"> <font class="blackboldtxt"><font color="#003e7b">Total Village Area :</font></font> <font class="smalltext"><font color="#d36000">*</font></font></td> <td style="padding-top: 10px;" valign="top"> <input class="addtextfiled" size="15" name="TotalVillageArea" value=""> </td> </tr> <tr> <td colspan="2" valign="top" align="middle"><br> <input name="file_name" value="newuser" type="hidden"> <input name="Country" value="" type="hidden"> <input name="reset" src="login.php_files/submit-button.gif" value="Clear" type="reset" width="62" border="0" height="19"> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <input name="post" src="login.php_files/submit-button.gif" value="Submit" type="submit" width="62" border="0"height="19" onClick='return check(frm)'> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <input name="reset" src="login.php_files/submit-button.gif" value="Back" type="reset" width="62" border="0" height="19" onClick="history.go(-1)"> </td> </tr> </tbody> </table> </form> </td> </tr> </tbody> </table> <!-- End of New Village Registration --> <jsp:useBean id="adinfo" class="ebean.Add_Village"></jsp:useBean> <% AddVillageInfo ad=new AddVillageInfo(); ad.setState("state"); ad.setDistrict("district"); ad.setTehsil("tehsil"); ad.setVillageName("villagename"); ad.setSurpanchName("surpanchname"); ad.setNoOfHouseHolds("noofhouseholds"); ad.setNoOfLandsellers("nooflandsellers"); ad.setTotalVillageArea("totalvillagearea")); boolean b=adinfo.save_add(ad); %> </body> </html>
it gives an error that it doesnt import my pkg
Ads