String resource="WEB-INF/config/jdbc.properties"; Properties properties=new Properties(); InputStream inputStream=request.getSession().getServletContext().getResourceAsStream(resource); if(inputStream!=null){ properties.load(inputStream); Class.forName(properties.getProperty("driver")); try{ Connection conn = DriverManager.getConnection(properties.getProperty("url"), properties.getProperty("username"), properties.getProperty("password")); Statement stmt = conn.createStatement(); String sqlQuery = "SELECT * FROM Table A "; ResultSet rs=stmt.executeQuery(sqlQuery); while(rs.next()){ %> <%=.......
↧