Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Insert title here</title>
- </head>
- <body>
- <%@page import="java.sql.*" %>
- <%
- try
- {
- Class.forName("oracle.jdbc.driver.OracleDriver");
- Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system", "system");
- PreparedStatement ps=con.prepareStatement("select * from studinfo");
- ResultSet rs=ps.executeQuery();
- while(rs.next())
- out.println(rs.getString(1)+" "+rs.getString(2)+" "+rs.getString(3));
- con.close();
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- %>
- </body>
- </html>
Add Comment
Please, Sign In to add comment