You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
1.0 KiB

<%@ page import="java.sql.*,oracle.jdbc.driver.OracleDriver"%>
<%@ page trimDirectiveWhitespaces="true" %>
<%
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","admin");
Statement stmt = conn.createStatement();
int index=request.getRequestURI().lastIndexOf('/');
String id = request.getRequestURI().substring(index, request.getRequestURI().length());
id = id.replace("/", "");
String status = "";
String comp_id = "";
String sql = "SELECT case when comp_status = 'A' then 'assigned' when comp_status = 'P' then 'pending' when comp_status = 'N' then 'open' else 'completed' end as status FROM COMP_REG where comp_id="+id;
//out.println(sql);
ResultSet rs = stmt.executeQuery(sql);
while(rs.next())
{
comp_id = rs.getString("comp_id");
status = rs.getString("status");
}
%>{Complaint ID': <%=comp_id %>, 'status': '<%= status %>'}<%
// Returns all employees (active and terminated) as json.
response.setContentType("application/json");
%>