Sorry I posted this to a different forum by mistake so I'm posting it in the proper forum now. THx.

I am having a few problems and I cannot explain why this is happening. I am using a Java servlet to connect to an Oracle Database. Using the "SELECT * FROM <TABLENAME>" command, the servlet is to retrieve all results and display them in an html file. I am using Java servlets and RESIN servlet webserver.

The problem that I am having is that the servlet

a) Doesn't show the results at all. By this I mean that the servlet runs and executes the code, returns and no SQL exception errors but returns empty results.

b) The servlet shows some results. It shows all the results from a different table but when I try to add to the table so that it has 5 records, it only shows 4, as if the code or database does not update.

I can't understand why it would do this. When I execute "SELECT * FROM <TABLENAME>" it is fine and shows all the results on SQL PLUS*. Could it be my code or anything?

Copy of my coding (this used to work, but now it only returns empty results):

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;

public class ost extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType("Text/html");
PrintWriter out = response.getWriter();

out.println("<HTML>");
out.println("<HEAD><TITLE>Oracle Example</TITLE></HEAD>");
out.println("<BODY BGCOLOR=\"#FFFFFF\">");
out.println("<CENTER>");
out.println("<B>Employees</B>");
out.println("<BR><BR>");

Connection conn = null;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection(
"jdbcracle:thin:@IPADDRESS:test1",
"system",
"manager");

Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM Emptest");

//Print start of table and column headers
out.println("<TABLE CELLSPACING=\"0\" CELLPADDING=\"3\" BORDER=\"1\">");
out.println("<TR><TH>ID</TH><TH>NAME</TH></TR>");

//Loop through results of query.
while(rs.next())
{
out.println("<TR>");
out.println("<TD>" + rs.getString("EmpID") + "</TD>");
out.println("<TD>" + rs.getString("Name") + "</TD>");
out.println("</TR>");
}

out.println("</TABLE>");
}
catch(SQLException e)
{
out.println("SQLException: " + e.getMessage() + "<BR>");
while((e = e.getNextException()) != null)
out.println(e.getMessage() + "<BR>");
}
catch(ClassNotFoundException e)
{
out.println("ClassNotFoundException: " + e.getMessage() + "<BR>");
}
finally
{
//Clean up resources, close the connection.
if(conn != null)
{
try
{
conn.close();
}
catch (Exception ignored) {}
}
}

out.println("</CENTER>");
out.println("</BODY>");
out.println("</HTML>");

}
}