-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathestimatedTimeAJAX.jsp
More file actions
28 lines (26 loc) · 815 Bytes
/
estimatedTimeAJAX.jsp
File metadata and controls
28 lines (26 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<%@page import="java.sql.*"%>
<%
String routeNo = request.getParameter("routeNo");
Connection con = null;
Statement st = null;
ResultSet rs = null;
try
{
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/shivajiroadways", "root", "1234");
st = con.createStatement();
String query = "select standName from routeStands WHERE routeNo = '" + routeNo + "'";
rs = st.executeQuery(query);
}
catch(Exception e)
{
out.print(e.getMessage());
}
%>
<option class="placeholder" value="" disabled selected style="color: rgb(214, 205, 205);">From</option>
<%
for(int i =1 ; rs.next(); i++)
{%>
<option value="<%=i%>"><%=rs.getString("standName")%></option>
<%}
%>