Results 1 to 5 of 5
  1. #1
    swee is offline Member
    Join Date
    Jan 2012
    Posts
    3
    Rep Power
    0

    Default is this program to do with apache maven

    try{

    ArrayList<AddBankBean> nd=new ArrayList<AddBankBean>();
    ADao u1=new ADao();
    nd=u1.userCheck();

    request.setAttribute("nd",nd);
    RequestDispatcher dispatcher = request.getRequestDispatcher("jsp/Ajsp.jsp");
    dispatcher.forward(request,response);



    }
    catch(Exception e)
    {

    }
    }

    public ArrayList<AddBankBean> userCheck( ) throws Exception{

    ArrayList<AddBankBean> nd=new ArrayList<AddBankBean>();
    Statement statement = null;
    Connection con = null;

    try {
    con = ConnectionDao.getConnection();
    // Create a statement object
    statement = con.createStatement();

    // Execute the SQL query
    System.out.println("The Lists are retrieved from database");
    ResultSet rs = statement.executeQuery("select * from bn" );


    while (rs.next())
    {
    AddBankBean temp=new AddBankBean();
    temp.setBank_id(Integer.parseInt(rs.getString(1))) ;
    temp.setBank_name(rs.getString(2));
    temp.setBranch(rs.getString(3));
    temp.setAddress(rs.getString(4));
    temp.setPhone_number(Long.parseLong(rs.getString(5 )));

    nd.add(temp);
    }


    // Print the result set

    } catch (Exception e) {
    e.printStackTrace();
    } finally {

    statement.close();
    con.close();
    }
    return nd;
    }<%@page import="bea.*"%>
    <%@page import="java.util.ArrayList"%>

    <table align="center">

    <tr>
    <td></td>
    <td>
    <form method="post" action="/Beta/EmployeeCommon">

    <table border="border" align="center">

    <tr>
    <td colspan="2" align="center" valign="middle">
    </tr>
    </td>
    <tr>
    <th>Student NSEP id</th>
    <th>Name</th>
    <th>college name </th>
    <th>address</th>

    </tr>

    <tr> </tr>
    <% ArrayList<StudentBean> arrName =(ArrayList) request.getAttribute("nd");



    for(int i=0;i<arrName.size();i++)
    {%>

    <td>

    <%=arrName.get(i).getstd_id()%>
    </td>

    <td>
    <%=arrName.get(i).getName()%>
    </td>
    <td>
    <%=arrName.get(i).getcollege_name()%>
    </td>
    <td>
    <%=arrName.get(i).getAddress()%>
    </td>

    </tr><%}%>
    <%-- <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>

    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>

    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,691
    Rep Power
    8

    Default Re: is this program to do with apache maven

    Do you know what maven is?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    swee is offline Member
    Join Date
    Jan 2012
    Posts
    3
    Rep Power
    0

    Default Re: is this program to do with apache maven

    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

    <%@page import="java.sql.*" %>
    <%

    bean = ()request.getAttribute("data");
    String name =bean.getcollege_name();

    %>

    <!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>NSEP</title>
    <link href="/Beta/css/style.css" rel="stylesheet" type="text/css" media="screen" />


    <
    </head>
    <body>
    <div id="wrapper">
    <div id="logo">
    <h1 align="center"><i>N </i></h1>



    </div>
    <hr />
    <div id="header">
    <div id="menu" >
    <ul> <table align="right">

    </table>

    </ul>
    </div>
    </div>
    <div id="page">
    <div id="page-bgtop">
    <div id="content">
    <div class="post">
    <div class="entry">
    <h3 align="center" > <i>Syyy </i> </h3>

    <br>

    <br><br>

    <center>
    <h4> Name:<%=collegename%></h4>

    <form name="regform" method="post" >
    <input type="hidden" name="result" value="listcollege">
    <table border=2>
    <tr>
    <td>1</td>
    <td> 2</td>

    <td>3</td>
    <td>4</td>
    <td>5</td>
    <td></td>
    </tr>

    <%
    Connection connection = null;
    Statement statement = null;
    ResultSet rs = null;

    connection = Connectionmanager.getConnection();
    statement= connection.createStatement();
    String QueryString = "select * from g ='"+ee+"'";
    rs = statement.executeQuery(QueryString);
    %>
    <%
    while (rs.next()) {
    %>


    <tr>
    <td><%=rs.getInt(1)%></td>
    <td><%=rs.getString(2)%></td>

    <td><%=rs.getString(3)%></td>
    <td><%=rs.getString(4)%></td>
    <td><%=rs.getString(18)%></td>

    </tr>

    <%
    }
    %>
    <% try{
    statement.close();
    connection.close();
    }
    catch(SQLException e){}


    %>
    </table>

    </form>

    </center>
    <center>
    <form method="post" action="on">
    <input type="submit" value="Confirm"></input>
    </form>
    </center>




    <br></br>
    </div>
    </div>
    </div>
    </div>
    </div>
    </body>
    </html>
    "select * from table1 where d='"+ 1+ "' AND pd='"+ 2+ "' AND ac='" + 3+ "'";

  4. #4
    swee is offline Member
    Join Date
    Jan 2012
    Posts
    3
    Rep Power
    0

    Default Re: is this program to do with apache maven

    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.*;

    public class Connectionmanager {
    static Connection conn;
    static String url;

    public static Connection getConnection() {

    String serverName = "172.24.137.30";
    String portNumber = "1521";
    String sid = "ora10G";

    String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":"
    + sid;
    String username = "";
    String password = "";

    try {

    // load the JDBC-ODBC Bridge driver
    Class.forName("oracle.jdbc.driver.OracleDriver");

    // connect to db using DriverManager
    // System.out.println("The Jdbc URL is " + url);
    conn = DriverManager.getConnection(url, username, password);

    return conn;
    }

    catch (ClassNotFoundException cnfex) {
    // System.out.println("Class not found !! " + cnfex);
    } catch (SQLException sqlex) {
    // System.out.println("SQL Exception !! " + sqlex);
    sqlex.printStackTrace();
    } catch (Exception ex) {
    // System.out.println("Exception has occured " + ex);
    } finally {

    }

    return conn;
    }
    }

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    18

    Default Re: is this program to do with apache maven

    It would probably help if you answered the question rather than posting unformatted code.
    NB: When posting code use code tags to retain formatting.

Similar Threads

  1. Installing Apache tomcat and maven into NetBeans
    By MostinCredible21 in forum Apache Commons
    Replies: 0
    Last Post: 01-03-2012, 08:57 PM
  2. Apache subversion with eclipse program
    By aianta in forum New To Java
    Replies: 0
    Last Post: 11-28-2011, 02:41 AM
  3. Apache / Tomcat and a separate JavaSE program
    By lambi in forum Networking
    Replies: 6
    Last Post: 03-30-2010, 09:00 AM
  4. Replies: 0
    Last Post: 04-20-2009, 06:26 PM
  5. Replies: 0
    Last Post: 11-15-2008, 07:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •