<%-- Document : viewmyprojects Created on : 18/06/2012, 02:34:10 م Author : mamer --%> <%-- Document : viewmyprojects Created on : 18/06/2012, 02:04:58 م Author : mamer --%> <%-- Document : viewmyprojects Created on : 14/06/2012, 07:34:34 م Author : mamer --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page language="java" import="java.util.*" %> <%@ page import="java.sql.*" %> <%@ page import="java.io.*" %> JSP Page
 

Your Projects:

 

<% try { String uId = request.getSession(true).getAttribute("uid").toString(); int userId = Integer.parseInt(uId); String connectionURL = "jdbc:mysql://localhost:3306/autodoc"; Connection connection = null; Statement statement = null; ResultSet rs = null; Class.forName("com.mysql.jdbc.Driver").newInstance(); connection = DriverManager.getConnection(connectionURL, "root", "root"); statement = connection.createStatement(); String QueryString = "select name,description from projects where id='"+userId+"'"; rs = statement.executeQuery(QueryString); rs=statement.getResultSet(); %>
<% while (rs.next()) { %> <% } %> <% // close all the connections. rs.close(); statement.close(); connection.close(); } catch (Exception ex) { %> <% out.println("Unable to connect to database."); } %>
<%=rs.getInt(1)%> <%=rs.getString(2)%>