Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

this jsp page presents headings, it does not pull back results, why?

Status
Not open for further replies.

johnpele

Technical User
Feb 6, 2003
7
IE

<HTML>
<HEAD>

<title>Employee List</title>

</head>
<BODY>
<%@ page language=&quot;java&quot; contentType=&quot;text/html&quot; import=&quot;java.sql.*&quot; %>
<TABLE BORDER=1 width=&quot;75%&quot;>
<TR><TH>Last Name</TH><TH>First Name</TH></TR>
<%

Connection conn = null;
Statement st = null;
ResultSet rs = null;
try{

// Load Oracle driver
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

// Connect to the database
String dbaddress = (&quot;jdbc:eek:racle:thin:mad:macha.wit.ie:1521:MACH&quot;);
conn = DriverManager.getConnection (&quot;jdbc:eek:racle:thin:mad:macha.wit.ie:1521:MACH&quot;, &quot;W99418665&quot;,&quot;QEGXZA&quot;);


st = conn.createStatement();
rs = st.executeQuery(&quot;SELECT * FROM employees&quot;);
while (rs.next()) {

%>

<TR><TD><%= rs.getString(&quot;lname_txt&quot;) %></TD>
<TD><%= rs.getString(&quot;fname_txt&quot;) %></TD></TR>
<%
}
%>
</TABLE>
<%
} catch (Exception ex){
ex.printStackTrace();
%>
</table>
Oooops, something bad happened:
<%
} finally {
if (rs != null) rs.close();
if (st != null) st.close();
if (conn != null) conn.close();
}
%>
</BODY>
 
do you get an error message? Make sure you &quot;View/Source&quot; from the browser.

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top