%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %><%@taglib uri="http://java.sun.com/jstl/core" prefix="c" %><% String name = ""; String email = ""; if(session.getAttribute("owner_id")==null) { try { response.sendRedirect("owner_login.jsp"); }catch(Exception e1){out.print(e1.toString());} } else { int owner_id = new Integer((String)session.getAttribute("owner_id")).intValue(); try { PreparedStatement Ps2; Class.forName("org.gjt.mm.mysql.Driver"); //Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc:mysql://localhost/sstrehli1?user=sstrehli1&password=frboadmin2007"); String query = "SELECT o.owner_id, o.name, o.email FROM owner o WHERE o.owner_id = ?"; Ps2 = con.prepareStatement(query); Ps2.setInt(1, owner_id); ResultSet Rs = Ps2.executeQuery(); if(Rs.next()) { name = Rs.getString("name"); email = Rs.getString("email"); } Rs.close(); Ps2.close(); con.close(); }catch(Exception e2){out.print(e2.toString());} } %>
|
|