Results 1 to 5 of 5
- 01-12-2012, 07:05 PM #1
Member
- Join Date
- Jan 2012
- Posts
- 3
- Rep Power
- 0
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
- 01-12-2012, 07:06 PM #2
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!
- 01-13-2012, 06:41 AM #3
Member
- Join Date
- Jan 2012
- Posts
- 3
- Rep Power
- 0
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+ "'";
- 01-13-2012, 07:43 AM #4
Member
- Join Date
- Jan 2012
- Posts
- 3
- Rep Power
- 0
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;
}
}
- 01-13-2012, 12:54 PM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
Similar Threads
-
Installing Apache tomcat and maven into NetBeans
By MostinCredible21 in forum Apache CommonsReplies: 0Last Post: 01-03-2012, 08:57 PM -
Apache subversion with eclipse program
By aianta in forum New To JavaReplies: 0Last Post: 11-28-2011, 02:41 AM -
Apache / Tomcat and a separate JavaSE program
By lambi in forum NetworkingReplies: 6Last Post: 03-30-2010, 09:00 AM -
Maven plugin for eclipse + "Updating Maven Dependencies" problem??
By sbutt in forum EclipseReplies: 0Last Post: 04-20-2009, 06:26 PM -
Apache Axis2 is built on Apache AXIOM, a new high performance, pull-based XML object.
By anusoniaa in forum XMLReplies: 0Last Post: 11-15-2008, 07:29 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks