*
The moose likes Tomcat and the fly likes Display data from oracle to tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Display data from oracle to tomcat" Watch "Display data from oracle to tomcat" New topic
Author

Display data from oracle to tomcat

Emma Aziz
Greenhorn

Joined: Apr 27, 2009
Posts: 23
I have jsp file parked under catalina_home\webapps\mydir\my.jsp:

<%@ page import="java.sql.*"%>
<%Class.forName("oracle.jdbc.driver.OracleDriver");%>
<html>
<body>
<h1>Welcome to Emma's page</h1>
</body>
<%
try{
Connection connection = DriverManager.getConnection("jdbcracle:thin:@database:1521:SID",
"user1", "password");
out.println("Test");
Statement statement = connection.createStatement();
ResultSet resultset = statement.executeQuery("SELECT * FROM tblCustomer");
while(resultset.next()){
out.println(resultset.getString("prod_desc"));
}
out.println("Test1");
}
catch(Exception e){
out.println("Test1");
out.println(e);
}
%>
<body>
<h1>Welcome to Emma's page</h1>
</body>
</html>

Previously, it worked fine, displaying the text and result from database until I changed something in server.xml and web.xml (web.xml under WEB-INF, not in conf folder). I cannot see anything from the database anymore, just text.

How is the correct configuration of server.xml in order for me to display the results?

Thanks in advance.

Regards,
Emma
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Display data from oracle to tomcat
 
Similar Threads
Null Pointer Exception
login servlet = login successful doesn't show
In JSP + Jdbc web page can "System.out.println()" can be used?
Java to Display Data from Database
405 error