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> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td
Re: is this program to do with apache maven
Do you know what maven is?
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+ "'";
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;
}
}
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.