This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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


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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Display data from oracle to tomcat