pradeepa sakthi

Greenhorn
+ Follow
since Dec 26, 2008
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 pradeepa sakthi

hai to all,
please help me to retrieve record one by one by click the button.
please check my code.it is not work..
my code is:

<%@ page import="java.sql.*"%>

<SCRIPT LANGUAGE="JavaScript">

function move()
{
var cu = 0
cu = parseInt(document.form1.hidden.value) + 1
document.form1.hidden.value = cu
form1.submit()
}

</SCRIPT>

<FORM NAME="form1" ACTION="query.jsp" >

<%
int cu=1;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection con=DriverManager.getConnection("jdbc:odbc:tdsn");
if(request.getParameter("hidden") != null)


cu = Integer.parseInt(request.getParameter("hidden"));

String useri=request.getParameter("D1");

if(useri.equals("SiteType"))
{
String a=request.getParameter("T1");
PreparedStatement ps=con.prepareStatement("SELECT sitetype,buildinght,towerht from tower where sitetype=? and basic.sid=tower.sid");
ps.setString(1,a);
ResultSet rs=ps.executeQuery();

%>
<%
if(rs.next())
{

String r=rs.getString("sitetype");
String d=rs.getString("buildinght");
String f=rs.getString("towerht");


%>
<table>
<tr><%=r%></tr>
<tr><%=d%></tr>
<tr><%=f%></tr>

<input type="button" value="next" onclick="move();">
<input type="hidden" name="hidden" value="<%=cu%>">

<%
}}
%>
12 years ago
JSP
hai,
you can use

response.sendRedirect("a.jsp");
12 years ago
JSP
hai to all,
please help me...
i want to retrieve record one by one from database when click button... here is my code..but not work well.. i think i did some mistake in it.but i do not know where it is.
my project has been delayed by this problem.. . please help
me...please guide me in right way...
Thank in advance...





<%@ page import="java.sql.*"%>

<SCRIPT LANGUAGE="JavaScript">

function move()
{
var cu = 0
cu = parseInt(document.form1.hidden.value) + 1
document.form1.hidden.value = cu
form1.submit()
}

</SCRIPT>

<FORM NAME="form1" ACTION="query.jsp" >

<%
int cu=1;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection con=DriverManager.getConnection("jdbc:odbc:tdsn");
if(request.getParameter("hidden") != null)


cu = Integer.parseInt(request.getParameter("hidden"));

String useri=request.getParameter("D1");

if(useri.equals("SiteType"))
{
String a=request.getParameter("T1");
PreparedStatement ps=con.prepareStatement("SELECT sn,StrategicSite,City,CensusTower,Address,Lattitude,Longitude,SharingPartner,Site,RFI,BSC,SECA,SECB,SECC,sitetype,buildinght,towerht,sour,dg,Capa,bm,bcapa,ethiload,totalload,operator,Staus,Media,Id,Vendor,MW,SDH,sa,sb,sc,sd,se,sf,sg,sh,si FROM tower,basic,power,txd,Rfd where sitetype=? and basic.sid=tower.sid and tower.sid=power.sid and tower.sid=txd.sid and tower.sid=Rfd.sid");
ps.setString(1,a);
ResultSet rs=ps.executeQuery();

%>
<%
if(rs.next())
{

String r=rs.getString("sitetype");
String d=rs.getString("buildinght");
String f=rs.getString("towerht");
String sn=rs.getString("sn");
String s=rs.getString("StrategicSite");

String s2=rs.getString("City");


String s5=rs.getString("CensusTower");
String s6=rs.getString("Address");
String s7=rs.getString("Lattitude");
String s8=rs.getString("Longitude");
String s9=rs.getString("SharingPartner");
String s10=rs.getString("Site");
String s11=rs.getString("RFI");
String s12=rs.getString("BSC");
String s13=rs.getString("SECA");
String s14=rs.getString("SECB");
String s15=rs.getString("SECC");
String p1=rs.getString("sour");
String p2=rs.getString("dg");
String p3=rs.getString("Capa");
String p4=rs.getString("bm");
String p5=rs.getString("bcapa");
String p6=rs.getString("ethiload");
String p7=rs.getString("totalload");
String p8=rs.getString("operator");
String p9=rs.getString("Staus");
String t1=rs.getString("Media");
String t2=rs.getString("ID");
String t3=rs.getString("Vendor");
String t4=rs.getString("MW");
String t5=rs.getString("SDH");
String sa=rs.getString("sa");
String sb=rs.getString("sb");
String sc=rs.getString("sc");
String sd=rs.getString("sd");
String se=rs.getString("se");
String sf=rs.getString("sf");
String sg=rs.getString("sg");
String sh=rs.getString("sh");
String si=rs.getString("si");
cu ++ ;
%>
<input type="button" value="next" onclick="move();"> <input type="hidden" name="hidden" value="<%=cu%>"> <% }} %>
Basic & Bss Details Tower Details  Tx Details Power Details          Rf Details
Strategic Site <%=s%> Site Type <%=r%> Media <%=t1%>  Power Source

 

<%=p1%> Ant Ht Sec <%=sa%>
Sec <%=sb%>
City <%=s2%> Building HT <%=d%> ETI E1 ID  ht   <%=t2%> DG Make <%=p2%>
Tower Ht <%=f%> Vendor <%=t3%>   Capa <%=p3%> Sec <%=sc%>
Census Tower <%=s5%>   Equip MW <%=t4%> Battery Make <%=p4%> Mech.Tilt Sec <%=sd%>
SDH <%=t5%> Capa <%=p5%> Sec <%=se%>
Address <%=s6%>   Ethisalat Load

(Amps)

<%=p6%> Sec

 

<%=sf%>
Total Load(Amps) <%=p7%> Elec.Tilt Sec <%=sg%>
Lattitude <%=s7%> External Alarm

(Extn)

Operator <%=p8%> Sec <%=sh%>
Longitude <%=s8%> Status <%=p9%> Sec <%=si%>
Sharing Partner <%=s9%>

                                   

              Dates

                  

 
Site <%=s10%> Survey    
RFI <%=s11%> RFI  
BSC <%=s12%> Integration  
TRX config Sec <%=s13%> On Air  
Sec <%=s14%>  
Sec <%=s15%>
</div></form>

 


 


 


 




</body>

</html>

12 years ago
JSP

hai to all,

how can i retrieve more than one tables data from access database which is connected by primary key constraints in jsp?
how can i write query for this???
Thank in advance..
Hi,
i can suggest to you read good jsp tutorial..This is best way.
Thanks & regards
Pradeepa sakthi
13 years ago
JSP
Thank you sandeep and devi for response,

My HTML code :
<form action="reg.jsp">

<input name="R1" type="radio" value="radiobutton" checked>
Male
<input name="R2" type="radio" value="radiobutton">
Female

<input type="submit" name="Submit" value="Submit">

</form>

Jsp Code:

<%@ page import="java.sql.*"%>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:hdsn");if((R1==Checked)&& equals("Male"))
{
String Sex=request.getParameter("R1");
else
{
String Sex=request.getParameter("R2");
PreparedStatement ps=con.prepareStatement("insert into computer values(?)");
ps.setString(1,Sex);
ps.executeUpdate();
%>
<%
}
}
%>
when i compile my code..it should displayed
Syntax: "}" inserted to complete StatementNoShortIf

ERROR..

i don't know..whether it is Misplaced Parenthesis in my code..
please help me.how can i store Radio button value into database..
13 years ago
JSP
can someone help me?how can i get value from radio button to store database in jsp code.
13 years ago
JSP
can someone help me?how can i get value from radio button to store database in jsp code.
13 years ago
JSP
Thank you.i think not necessary to put option values in it.but it works.i had put data values not into the form.Tht's why the action couldn't be performed.now it works well.


How can i store radio button value into database.
My HTML code :
<form action="reg.jsp">

<input name="R1" type="radio" value="radiobutton" checked>
Male
<input name="R2" type="radio" value="radiobutton">
Female

<input type="submit" name="Submit" value="Submit">

</form>

Jsp Code:

<%@ page import="java.sql.*"%>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:hdsn");if((R1==Checked)&& equals("Male"))
{
String Sex=request.getParameter("R1");
else
{
String Sex=request.getParameter("R2");
PreparedStatement ps=con.prepareStatement("insert into computer values(?)");
ps.setString(1,Sex);
ps.executeUpdate();
%>
<%
}
}
%>
when i compile my code..it should displayed
Syntax: "}" inserted to complete StatementNoShortIf

ERROR..

i don't know..whether it is Misplaced Parenthesis in my code..
please help me.how can i store Radio button value into database..
Thanks in advance.

[ December 27, 2008: Message edited by: pradeepa sakthi ]
[ December 27, 2008: Message edited by: pradeepa sakthi ]
13 years ago
JSP
Thank for your response.but there is no data stored in DATABASE.
Here My Html code is:
<select name="S2">

<option selected="selected">Computer</option>
<input type="submit" name="Submit" value="Submit">
</form>

My Jsp Code is:

<%@ page import="java.sql.*"%>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:epdsn");
String Depar=request.getParameter("S2");
if(Depar.equals("Computer"))
{
PreparedStatement ps=con.prepareStatement("insert into computer values(?)");
ps.setString(1,Depar);
ps.executeUpdate();
%>
<%
}

%>
Hope you understand this problem.kindly give me response.thankyou
13 years ago
JSP
Hai,
Anyone can help me?How can i store selected item in data base.
if i select item from dropdown box to store database using jsp there is no items stored in database..if i use textfield it will stored..
how it is possible?
[ December 27, 2008: Message edited by: pradeepa sakthi ]
13 years ago
JSP