gopi sri

Greenhorn
+ Follow
since Nov 11, 2008
Merit badge: grant badges
For More
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 gopi sri

hello preethi....
oh great you are using good web server..you set the classpath for your web server using servlet-api.jar file.

goto->mycomputer->rightclick->properties->press Advance tab-> click EnvironmentVariables-> window open

you should enter following
variable name : classpath
variable value: D:\apache-tomcat-6.0.14\lib\servlet-api.jar;
OR
/usr/local/apache-tomcat/common/lib\servlet-api.jar;

i given D:\apache .. since i have apache tomacat in D: drive !! you enter the path where you apached is located..

tak care,
gopi
gopinath65@gmail.com
15 years ago
hai preethi

you not set the classpath for your web server... which web server you using to support your servlet files ?.

set the classpath for your webserver, your errors will be rectified.

Tell to Difficulties iam very difficult..gud luck preethi

regards
gopi
gopinath65@gmail.com
15 years ago
Hai Bob Paul,

i hope you not added Ojdbc jar file in your java class path..
Even if you add ojdbc jar file please check whether it is the latest one becz for oracle 9i you should add ojdbc14 jar file in you drive. Once you added in your drive.set the classpath of ojdbc14 jar file in your java.

with regards,
Gopi
gopinath65@gmail.com
hello friends

i tried with servlet also. i created seperate file for database connections. still iam facing problem with insertion of checkbox values.

i can able to retrieve the values from database then i stored those values in checkbox. Now the checked values from checkbox should insert into db, here iam facing problem..First iam trying to display the checked values in out.println statement in new jsp page using request.getParameterValues("checkboxname"), but i cannot ablt to pass the values from first jsp page to second jsp page..
here is my code..first.jsp

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

<html>
<head>
<title>display data from the table using jsp</title>
</head>
<body>
<h2 align="center"></h2>
<select id="cbosex" name="cbosex">
<option value="true">Male</option>
<option value="false">Female</option>
</option>

<%
try {

Connection con = null;
Statement st= null;
ResultSet rs = null;
String s;


Class.forName("org.gjt.mm.mysql.Driver");
con=DriverManager.getConnection("jdbc:mysql://192.168.1.201:3306/e_busticketing","root","password");
st = con.createStatement();
out.println("connected");
String sql="select seat_no from e_busticketing.seat_mast where bus_id=1001";
rs=st.executeQuery(sql);

%>
<TABLE cellpadding="15" border="1" style="background-color: #ffffcc;" width=20% align="center">
<%
while (rs.next())
{
s=rs.getString("seat_no");

%>
<TR>
<TD><INPUT TYPE=CHECKBOX NAME=c1 value='<%=s%>'><%=s%>


<% } %>


</TD>

</TR>

<%
}
%>
<%
// close all the connections.
rs.close();
st.close();
con.close();

}
catch (Exception ex)
{
%>
</font>

<font size="+3" color="red"></b>
<%
out.println("Unable to connect to database.");
}
%>


</TABLE><TABLE align="center">
<TR>
<TD><FORM ACTION="second.jsp" method=get>

<input type="submit" value="submit">
</TD>
</TR>
</TABLE>
</font>
</body>
</html>

==========================
second.jsp

<html>
<body>
<%! String[] se; %>
<center>
You have selected:

<% se = request.getParameterValues("c1");
if (se != null)
{
for (int i = 0; i < se.length; i++)
{
out.println ("<b>"+se[i]+"<b>");
}
} else
out.println ("<b>none<b>");%>
</center></body>
</html>

regards
gopi
gopinath65@gmail.com
hai any one can help regarding this.

iam involved in e-ticketing project..

iam going to retrieve ticket values from database to jsp page. Now i want to book the ticket so i will select the ticket using checkbox..the selected ticket value should be insert into mysql db..i tried to insert but its not inserting can anyone help me..
my code is here below :


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

<html>
<head>
<title>display data from the table using jsp</title>
</head>
<body>
<h2 align="center"></h2>
<select id="cbosex" name="cbosex">
<option value="true">Male</option>
<option value="false">Female</option>
</option>

<%
try {

Connection con = null;
Statement st= null;
ResultSet rs = null;


Class.forName("org.gjt.mm.mysql.Driver");
con=DriverManager.getConnection("jdbc:mysql://192.168.1.201:3306/e_busticketing","root","password");
st = con.createStatement();
out.println("connected");
String sql="select seat_no from e_busticketing.seat_mast where bus_id=1001";
rs=st.executeQuery(sql);

%>
<TABLE cellpadding="15" border="1" style="background-color: #ffffcc;" width=20% align="center">
<%
while (rs.next()) {
%>
<TR>
<TD><INPUT TYPE=CHECKBOX NAME=c1 value=<%=rs.getString("seat_no")%> ></TD>

</TR>
<% } %>
<%
// close all the connections.
rs.close();
st.close();
con.close();

}
catch (Exception ex)
{
%>
</font>

<font size="+3" color="red"></b>
<%
out.println("Unable to connect to database.");
}
%>
</TABLE><TABLE align="center">
<TR>
<TD><FORM ACTION="busdetail.jsp" method="get" >
<button type="submit"><-- back</button></TD>
</TR>
</TABLE>
</font>

<%
/*
try
{
Class.forName("org.gjt.mm.mysql.Driver");
con=DriverManager.getConnection("jdbc:mysql://192.168.1.201:3306/e_busticketing","root","password");
out.println("connected sucessfully");

Statement st = con.createStatement();
int numRowsChanged = st.executeUpdate("insert into e_busticketing.seat_details(seat) values (c1)";

out.println("data inserted");

}



catch (Exception e)
{
e.printStackTrace();
}
}
}
*/
%>
</body>
</html>
regards
gopi
[ November 11, 2008: Message edited by: Bear Bibeault ]