package com.ankit;
import java.util.Arrays;
class Employee {
private String id;
private String name;
/**
* Employee constructor
*/
public Employee(String id, String name) { // constructor
this.id = id;
this.name = name;
}
@Override
public String toString() {
return "Employee[id=" + id + ", name=" + name + "] ";
}
}
/** Copyright (c), AnkitMittal JavaMadeSoEasy.com */
/**
* @author AnkitMittal
* Copyright (c), AnkitMittal . All Contents are copyrighted and must not be reproduced in any form.
* This class provides custom implementation of ArrayList(without using java api's)
* Insertion order of objects is maintained.
* Implementation allows you to store null as well.
* @param <E>
*/
class ArrayListCustom<E> {
private static final int INITIAL_CAPACITY = 10;
private Object elementData[]={};
private int size = 0;
/**
* constructor.
*/
public ArrayListCustom() {
elementData = new Object[INITIAL_CAPACITY];
}
/**
* method adds elements in ArrayListCustom.
*/
public void add(E e) {
if (size == elementData.length) {
ensureCapacity(); //increase current capacity of list, make it double.
}
elementData[size++] = e;
}
/**
* method returns element on specific index.
*/
@SuppressWarnings("unchecked")
public E get(int index) {
if ( index <0 || index>= size) { //if index is negative or greater than size of size, we throw Exception.
throw new IndexOutOfBoundsException("Index: " + index + ", Size " + index);
}
return (E) elementData[index]; //return value on index.
}
/**
* method returns removedElement on specific index.
* else it throws IndexOutOfBoundException if index is negative or greater than size of size.
*/
public Object remove(int index) {
if ( index <0 || index>= size) { //if index is negative or greater than size of size, we throw Exception.
throw new IndexOutOfBoundsException("Index: " + index + ", Size " + index);
}
Object removedElement=elementData[index];
for(int i=index;i<size - 1;i++){
elementData[i]=elementData[i+1];
}
size--; //reduce size of ArrayListCustom after removal of element.
return removedElement;
}
/**
* method increases capacity of list by making it double.
*/
private void ensureCapacity() {
int newIncreasedCapacity = elementData.length * 2;
elementData = Arrays.copyOf(elementData, newIncreasedCapacity);
}
/**
* method displays all the elements in list.
*/
public void display() {
System.out.print("Displaying list : ");
for(int i=0;i<size;i++){
System.out.print(elementData[i]+" ");
}
}
}
/** Copyright (c), AnkitMittal JavaMadeSoEasy.com */
/**
* Main class to test ArrayListCustom functionality.
*/
public class ArrayListEmployee {
public static void main(String...a) {
ArrayListCustom<Employee> list = new ArrayListCustom<Employee>();
list.add(new Employee("1", "sam"));
list.add(new Employee("2", "amy"));
list.add(new Employee("3", "wil"));
list.add(new Employee("4", "cat"));
list.add(new Employee("1", "sam"));
list.add(new Employee("2", "amy"));
list.add(null);
list.display();
System.out.println("\nelement at index "+1+" = "+list.get(1));
System.out.println("element removed from index "+1+" = "+list.remove(1));
System.out.println("\nlet's display list again after removal at index 1");
list.display();
//list.remove(11); //will throw IndexOutOfBoundsException, because there is no element to remove on index 11.
//list.get(11); //will throw IndexOutOfBoundsException, because there is no element to get on index 11.
}
}
import java.util.Arrays;
class Employee {
private String id;
private String name;
/**
* Employee constructor
*/
public Employee(String id, String name) { // constructor
this.id = id;
this.name = name;
}
@Override
public String toString() {
return "Employee[id=" + id + ", name=" + name + "] ";
}
}
/** Copyright (c), AnkitMittal JavaMadeSoEasy.com */
/**
* @author AnkitMittal
* Copyright (c), AnkitMittal . All Contents are copyrighted and must not be reproduced in any form.
* This class provides custom implementation of ArrayList(without using java api's)
* Insertion order of objects is maintained.
* Implementation allows you to store null as well.
* @param <E>
*/
class ArrayListCustom<E> {
private static final int INITIAL_CAPACITY = 10;
private Object elementData[]={};
private int size = 0;
/**
* constructor.
*/
public ArrayListCustom() {
elementData = new Object[INITIAL_CAPACITY];
}
/**
* method adds elements in ArrayListCustom.
*/
public void add(E e) {
if (size == elementData.length) {
ensureCapacity(); //increase current capacity of list, make it double.
}
elementData[size++] = e;
}
/**
* method returns element on specific index.
*/
@SuppressWarnings("unchecked")
public E get(int index) {
if ( index <0 || index>= size) { //if index is negative or greater than size of size, we throw Exception.
throw new IndexOutOfBoundsException("Index: " + index + ", Size " + index);
}
return (E) elementData[index]; //return value on index.
}
/**
* method returns removedElement on specific index.
* else it throws IndexOutOfBoundException if index is negative or greater than size of size.
*/
public Object remove(int index) {
if ( index <0 || index>= size) { //if index is negative or greater than size of size, we throw Exception.
throw new IndexOutOfBoundsException("Index: " + index + ", Size " + index);
}
Object removedElement=elementData[index];
for(int i=index;i<size - 1;i++){
elementData[i]=elementData[i+1];
}
size--; //reduce size of ArrayListCustom after removal of element.
return removedElement;
}
/**
* method increases capacity of list by making it double.
*/
private void ensureCapacity() {
int newIncreasedCapacity = elementData.length * 2;
elementData = Arrays.copyOf(elementData, newIncreasedCapacity);
}
/**
* method displays all the elements in list.
*/
public void display() {
System.out.print("Displaying list : ");
for(int i=0;i<size;i++){
System.out.print(elementData[i]+" ");
}
}
}
/** Copyright (c), AnkitMittal JavaMadeSoEasy.com */
/**
* Main class to test ArrayListCustom functionality.
*/
public class ArrayListEmployee {
public static void main(String...a) {
ArrayListCustom<Employee> list = new ArrayListCustom<Employee>();
list.add(new Employee("1", "sam"));
list.add(new Employee("2", "amy"));
list.add(new Employee("3", "wil"));
list.add(new Employee("4", "cat"));
list.add(new Employee("1", "sam"));
list.add(new Employee("2", "amy"));
list.add(null);
list.display();
System.out.println("\nelement at index "+1+" = "+list.get(1));
System.out.println("element removed from index "+1+" = "+list.remove(1));
System.out.println("\nlet's display list again after removal at index 1");
list.display();
//list.remove(11); //will throw IndexOutOfBoundsException, because there is no element to remove on index 11.
//list.get(11); //will throw IndexOutOfBoundsException, because there is no element to get on index 11.
}
}
/*Output
Displaying list : Employee[id=1, name=sam] Employee[id=2, name=amy] Employee[id=3, name=wil] Employee[id=4, name=cat] Employee[id=1, name=sam] Employee[id=2, name=amy] null
element at index 1 = Employee[id=2, name=amy]
element removed from index 1 = Employee[id=2, name=amy]
let's display list again after removal at index 1
Displaying list : Employee[id=1, name=sam] Employee[id=3, name=wil] Employee[id=4, name=cat] Employee[id=1, name=sam] Employee[id=2, name=amy] null
*/
Displaying list : Employee[id=1, name=sam] Employee[id=2, name=amy] Employee[id=3, name=wil] Employee[id=4, name=cat] Employee[id=1, name=sam] Employee[id=2, name=amy] null
element at index 1 = Employee[id=2, name=amy]
element removed from index 1 = Employee[id=2, name=amy]
let's display list again after removal at index 1
Displaying list : Employee[id=1, name=sam] Employee[id=3, name=wil] Employee[id=4, name=cat] Employee[id=1, name=sam] Employee[id=2, name=amy] null
*/
๐๐๐๐ซ" ๐๐ง๐ญ๐๐ซ๐ฏ๐ข๐๐ฐ ๐๐ฎ๐๐ฌ๐ญ๐ข๐จ๐ง๐ฌ - ๐๐๐๐
Based on Uber's job portal, they are hiring for multiple SDE1 and SDE2 positions right now. Here is a list of questions that have been asked by Uber in the last few months.
The compilation provided here is public information that is scattered around on multiple sites. You shouldn't try to use these as preparation material, but rather use these for self-assessment.
๐๐ผ๐ป๐๐๐ฟ๐๐ฐ๐๐ถ๐๐ฒ ๐๐น๐ด๐ผ๐ฟ๐ถ๐๐ต๐บ๐
1.) Split String => https://lnkd.in/eTb6VDmC
2.) Bin packing problem => https://lnkd.in/eXZKX3Sv
๐๐ผ๐บ๐ฏ๐ถ๐ป๐ฎ๐๐ผ๐ฟ๐ถ๐ฐ๐
1.) Sum of smallest elements in distinct sets => https://lnkd.in/exm7jDTm
๐๐๐ป๐ฎ๐บ๐ถ๐ฐ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ด
1.) Kth Step Sequence => https://lnkd.in/ertBsik7
2.) Collecting coins [Combinatorics involved] => https://lnkd.in/eqM-zDyi
๐๐ฟ๐ฎ๐ฝ๐ต
1.) Turn on all systems [Minimum spanning tree] => https://lnkd.in/ekj627TZ
2.) Turning Pages [DFS / Backtracking] => https://lnkd.in/eHsfBsM5
๐ง๐ฟ๐ฒ๐ฒ
1.) Delete Edge to minimize the difference in subtree sum => https://lnkd.in/edba9e8T
๐๐ถ๐๐๐ฒ๐
1.) Queries on Binary String [Queues can be used] => https://lnkd.in/edZRjGck
๐๐ฎ๐๐ต๐บ๐ฎ๐ฝ
1.) Insert Delete Get Random => https://lnkd.in/eRk-hSKW
2.) Implement a hash map => https://lnkd.in/eznHKki3
๐ฆ๐๐ฎ๐ฐ๐ธ๐
1.) Implement a queue with two stacks => https://lnkd.in/ebJbDced
๐๐ถ๐ป๐ฎ๐ฟ๐ ๐ฆ๐ฒ๐ฎ๐ฟ๐ฐ๐ต
1.) Index of a rotation point in an array => https://lnkd.in/e2KQs-Mq
Based on Uber's job portal, they are hiring for multiple SDE1 and SDE2 positions right now. Here is a list of questions that have been asked by Uber in the last few months.
The compilation provided here is public information that is scattered around on multiple sites. You shouldn't try to use these as preparation material, but rather use these for self-assessment.
๐๐ผ๐ป๐๐๐ฟ๐๐ฐ๐๐ถ๐๐ฒ ๐๐น๐ด๐ผ๐ฟ๐ถ๐๐ต๐บ๐
1.) Split String => https://lnkd.in/eTb6VDmC
2.) Bin packing problem => https://lnkd.in/eXZKX3Sv
๐๐ผ๐บ๐ฏ๐ถ๐ป๐ฎ๐๐ผ๐ฟ๐ถ๐ฐ๐
1.) Sum of smallest elements in distinct sets => https://lnkd.in/exm7jDTm
๐๐๐ป๐ฎ๐บ๐ถ๐ฐ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ด
1.) Kth Step Sequence => https://lnkd.in/ertBsik7
2.) Collecting coins [Combinatorics involved] => https://lnkd.in/eqM-zDyi
๐๐ฟ๐ฎ๐ฝ๐ต
1.) Turn on all systems [Minimum spanning tree] => https://lnkd.in/ekj627TZ
2.) Turning Pages [DFS / Backtracking] => https://lnkd.in/eHsfBsM5
๐ง๐ฟ๐ฒ๐ฒ
1.) Delete Edge to minimize the difference in subtree sum => https://lnkd.in/edba9e8T
๐๐ถ๐๐๐ฒ๐
1.) Queries on Binary String [Queues can be used] => https://lnkd.in/edZRjGck
๐๐ฎ๐๐ต๐บ๐ฎ๐ฝ
1.) Insert Delete Get Random => https://lnkd.in/eRk-hSKW
2.) Implement a hash map => https://lnkd.in/eznHKki3
๐ฆ๐๐ฎ๐ฐ๐ธ๐
1.) Implement a queue with two stacks => https://lnkd.in/ebJbDced
๐๐ถ๐ป๐ฎ๐ฟ๐ ๐ฆ๐ฒ๐ฎ๐ฟ๐ฐ๐ต
1.) Index of a rotation point in an array => https://lnkd.in/e2KQs-Mq
lnkd.in
LinkedIn
This link will take you to a page thatโs not on LinkedIn
Hey, join my group on magicpin within the next 23 hours to 70% off up to Rs.400 on Food Vouchers Coupon code will be revealed on group completion.! There are only 49 slots left, so click here now: http://magp.in/cGccH
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Global Banking ..</title>
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function ctck()
{
var sds = document.getElementById("dum");
}
</script>
</head>
<body>
<div id="top_links">
<div id="header">
<h1>Online Banking System<span class="style1"></span></h1>
<h1>RajBank<span class="style1"></span></h1>
<h2>Your Professional Banking Partner</h2>
<A href="index.html"><IMG SRC="RajBankLogo2.jpg" alt="Business"width="100" height="60"></IMG></A>
</div>
<div id="navigation">
<ul>
<li><a href="createacc.jsp">NEW ACCOUNT</a></li>
<li><a href="balance1.jsp">BALANCE</a></li>
<li><a href="deposit1.jsp">DEPOSIT</a></li>
<li><a href="withdraw1.jsp">WITHDRAW</a></li>
<li><a href="transfer1.jsp">TRANSFER</a></li>
<li><a href="closeac1.jsp">CLOSE A/C</a></li>
<li><a href="logout.jsp">LOGOUT</a></li>
</ul>
</div>
<table style="width:897px; background:#FFFFFF; margin:0 auto;">
<tr >
<td width="300" valign="top" style="border-right:#666666 1px dotted;">
<div id="services"><h1>Services</h1><br>
<ul>
<li><a href="#">NetBanking</a></li>
<li><a href="#">Loan</a></li>
<li><a href="#">Credit Card</a></li>
</ul>
</div>
</td>
<td width="1200" valign="top">
<%
%>
<table><%
boolean status=false;
String num=request.getParameter("accountno");
int accountno=Integer.parseInt(num);
String username=request.getParameter("username");
String password=request.getParameter("password");
String ssn=(String)session.getAttribute("ssn");
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con1=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","Amanrash","Amanrash");
PreparedStatement ps1=con1.prepareStatement("Select * from customer where userid='"+username+"' and password='"+password+"' and ssn='"+ssn+"'");
ResultSet rs1=ps1.executeQuery();
//Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con2=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","Amanrash","Amanrash");
PreparedStatement ps2=con2.prepareStatement("Select * from new_account where account_no="+accountno+"");
ResultSet rs2=ps2.executeQuery();
if(rs1.next()&&rs2.next()){
status=true;
}
//if(status==true){
// out.print("Welcome " + username);
try {
if(status==true){
out.print("Welcome " + username);
//Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","Amanrash","Amanrash");
PreparedStatement ps=con.prepareStatement("Select * from NEW_ACCOUNT where account_no=?");
ps.setInt(1,accountno);
ResultSet rs=ps.executeQuery();
out.print("<table align='left' cellspacing='5' cellpadding='5'>");
out.print("<tr><th>USER ID</th><th>ACCOUNT NO</th><th>ACCOUNT TYPE</th><th>AMOUNT</th><th>SSN</th></tr>");
while(rs.next()){
int accountno1=rs.getInt(1);
session.setAttribute("accountno",accountno1);
System.out.print(accountno);
out.print("<tr>");
out.print("<td>" +username+ "</td>");
out.print("<td>" + rs.getInt(1) + "</td>");
out.print("<td>" + rs.getString(2) + "</td>");
out.print("<td>" + rs.getInt(3) + "</td>");
out.print("<td>" +ssn+ "</td>");
out.print("</tr>");
}
out.print("</table>");
Random r=new Random();
int tid=r.nextInt(123456789);
//Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con3=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","Amanrash","Amanrash");
PreparedStatement ps3=con3.prepareStatement("insert into transaction values(?)");
ps3.setInt(1,tid);
int
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Global Banking ..</title>
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function ctck()
{
var sds = document.getElementById("dum");
}
</script>
</head>
<body>
<div id="top_links">
<div id="header">
<h1>Online Banking System<span class="style1"></span></h1>
<h1>RajBank<span class="style1"></span></h1>
<h2>Your Professional Banking Partner</h2>
<A href="index.html"><IMG SRC="RajBankLogo2.jpg" alt="Business"width="100" height="60"></IMG></A>
</div>
<div id="navigation">
<ul>
<li><a href="createacc.jsp">NEW ACCOUNT</a></li>
<li><a href="balance1.jsp">BALANCE</a></li>
<li><a href="deposit1.jsp">DEPOSIT</a></li>
<li><a href="withdraw1.jsp">WITHDRAW</a></li>
<li><a href="transfer1.jsp">TRANSFER</a></li>
<li><a href="closeac1.jsp">CLOSE A/C</a></li>
<li><a href="logout.jsp">LOGOUT</a></li>
</ul>
</div>
<table style="width:897px; background:#FFFFFF; margin:0 auto;">
<tr >
<td width="300" valign="top" style="border-right:#666666 1px dotted;">
<div id="services"><h1>Services</h1><br>
<ul>
<li><a href="#">NetBanking</a></li>
<li><a href="#">Loan</a></li>
<li><a href="#">Credit Card</a></li>
</ul>
</div>
</td>
<td width="1200" valign="top">
<%
%>
<table><%
boolean status=false;
String num=request.getParameter("accountno");
int accountno=Integer.parseInt(num);
String username=request.getParameter("username");
String password=request.getParameter("password");
String ssn=(String)session.getAttribute("ssn");
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con1=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","Amanrash","Amanrash");
PreparedStatement ps1=con1.prepareStatement("Select * from customer where userid='"+username+"' and password='"+password+"' and ssn='"+ssn+"'");
ResultSet rs1=ps1.executeQuery();
//Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con2=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","Amanrash","Amanrash");
PreparedStatement ps2=con2.prepareStatement("Select * from new_account where account_no="+accountno+"");
ResultSet rs2=ps2.executeQuery();
if(rs1.next()&&rs2.next()){
status=true;
}
//if(status==true){
// out.print("Welcome " + username);
try {
if(status==true){
out.print("Welcome " + username);
//Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","Amanrash","Amanrash");
PreparedStatement ps=con.prepareStatement("Select * from NEW_ACCOUNT where account_no=?");
ps.setInt(1,accountno);
ResultSet rs=ps.executeQuery();
out.print("<table align='left' cellspacing='5' cellpadding='5'>");
out.print("<tr><th>USER ID</th><th>ACCOUNT NO</th><th>ACCOUNT TYPE</th><th>AMOUNT</th><th>SSN</th></tr>");
while(rs.next()){
int accountno1=rs.getInt(1);
session.setAttribute("accountno",accountno1);
System.out.print(accountno);
out.print("<tr>");
out.print("<td>" +username+ "</td>");
out.print("<td>" + rs.getInt(1) + "</td>");
out.print("<td>" + rs.getString(2) + "</td>");
out.print("<td>" + rs.getInt(3) + "</td>");
out.print("<td>" +ssn+ "</td>");
out.print("</tr>");
}
out.print("</table>");
Random r=new Random();
int tid=r.nextInt(123456789);
//Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con3=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","Amanrash","Amanrash");
PreparedStatement ps3=con3.prepareStatement("insert into transaction values(?)");
ps3.setInt(1,tid);
int
status3=ps3.executeUpdate();
System.out.println(status3);
}
else{
out.print("Please check your username and Password");
request.setAttribute("balance","Please check your username and Password");
%>
<jsp:forward page="balance1.jsp"></jsp:forward>
<%
}
}catch (Exception e) {
e.printStackTrace();
}
//}
//}
%></table><%
%>
</table>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*" %>
<%@ page import="javax.servlet.*"%>
<%@ page import="java.util.*"%>
System.out.println(status3);
}
else{
out.print("Please check your username and Password");
request.setAttribute("balance","Please check your username and Password");
%>
<jsp:forward page="balance1.jsp"></jsp:forward>
<%
}
}catch (Exception e) {
e.printStackTrace();
}
//}
//}
%></table><%
%>
</table>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*" %>
<%@ page import="javax.servlet.*"%>
<%@ page import="java.util.*"%>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Global Banking ..</title>
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function ctck()
{
var sds = document.getElementById("dum");
}
</script>
</head>
<body>
<div id="top_links">
<div id="header">
<h1>Online Banking System<span class="style1"></span></h1>
<h1>RajBank<span class="style1"></span></h1>
<h2>Your Professional Banking Partner</h2>
<A href="index.html"><IMG SRC="images/home1.gif"></IMG></A>
</div>
<div id="navigation">
<ul>
<li><a href="createacc.jsp">NEW ACCOUNT</a></li>
<li><a href="balance1.jsp">BALANCE</a></li>
<li><a href="deposit1.jsp">DEPOSIT</a></li>
<li><a href="withdraw1.jsp">WITHDRAW</a></li>
<li><a href="transfer1.jsp">TRANSFER</a></li>
<li><a href="closeac1.jsp">CLOSE A/C</a></li>
<li><a href="logout.jsp">LOGOUT</a></li>
</ul>
</div>
<table style="width:897px; background:#FFFFFF; margin:0 auto;">
<tr >
<td width="300" valign="top" style="border-right:#666666 1px dotted;">
<div id="services"><h1>Services</h1><br>
<ul>
<li><a href="#">NetBanking</a></li>
<li><a href="#">Loan</a></li>
<li><a href="#">Credit Card</a></li>
</ul>
</div>
</td>
<td width="1200" valign="top">
<%
%>
<table><%
boolean status=false;
long accountno=Long.parseLong(request.getParameter("accountno"));
//int num=Integer.parseInt(num);
String username=request.getParameter("username");
String password=request.getParameter("password");
String ssn=(String)session.getAttribute("ssn");
//Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con1=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","Amanrash","Amanrash");
PreparedStatement ps1=con1.prepareStatement("Select * from customer where userid='"+username+"' and password='"+password+"' and ssn='"+ssn+"'");
ResultSet rs1=ps1.executeQuery();
//Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con2=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","Amanrash","Amanrash");
PreparedStatement ps2=con2.prepareStatement("Select * from new_account where account_no="+accountno+"");
ResultSet rs2=ps2.executeQuery();
if(rs1.next()&&rs2.next()){
status=true;
}
//if(status==true){
// out.print("Welcome " + username);
try {
if(status==true){
out.print("Welcome " + username);
//Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","Amanrash","Amanrash");
PreparedStatement ps=con.prepareStatement("Select * from NEW_ACCOUNT where account_no=?");
ps.setLong(1,accountno);
ResultSet rs=ps.executeQuery();
out.print("<table align='left' cellspacing='5' cellpadding='5'>");
out.print("<tr><th>USER ID</th><th>ACCOUNT NO</th><th>ACCOUNT TYPE</th><th>AMOUNT</th><th>SSN</th></tr>");
while(rs.next()){
int accountno1=rs.getInt(1);
session.setAttribute("accountno",accountno1);
out.print(accountno);
out.print("<tr>");
out.print("<td>" +username+ "</td>");
out.print("<td>" + rs.getInt(1) + "</td>");
out.print("<td>" + rs.getString(2) + "</td>");
out.print("<td>" + rs.getInt(3) + "</td>");
out.print("<td>" +ssn+ "</td>");
out.print("</tr>");
}
out.print("</table>");
Random r=new Random();
int tid=r.nextInt(123456789);
//Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con3=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","Amanrash","Amanrash");
PreparedStatement ps3=con3.prepareStatement("insert into transaction values(?)");
ps3.setInt(1,tid);
int status3=ps3.executeUpdate();
out.println(status3);
}
else{
out.print("Please check
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Global Banking ..</title>
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function ctck()
{
var sds = document.getElementById("dum");
}
</script>
</head>
<body>
<div id="top_links">
<div id="header">
<h1>Online Banking System<span class="style1"></span></h1>
<h1>RajBank<span class="style1"></span></h1>
<h2>Your Professional Banking Partner</h2>
<A href="index.html"><IMG SRC="images/home1.gif"></IMG></A>
</div>
<div id="navigation">
<ul>
<li><a href="createacc.jsp">NEW ACCOUNT</a></li>
<li><a href="balance1.jsp">BALANCE</a></li>
<li><a href="deposit1.jsp">DEPOSIT</a></li>
<li><a href="withdraw1.jsp">WITHDRAW</a></li>
<li><a href="transfer1.jsp">TRANSFER</a></li>
<li><a href="closeac1.jsp">CLOSE A/C</a></li>
<li><a href="logout.jsp">LOGOUT</a></li>
</ul>
</div>
<table style="width:897px; background:#FFFFFF; margin:0 auto;">
<tr >
<td width="300" valign="top" style="border-right:#666666 1px dotted;">
<div id="services"><h1>Services</h1><br>
<ul>
<li><a href="#">NetBanking</a></li>
<li><a href="#">Loan</a></li>
<li><a href="#">Credit Card</a></li>
</ul>
</div>
</td>
<td width="1200" valign="top">
<%
%>
<table><%
boolean status=false;
long accountno=Long.parseLong(request.getParameter("accountno"));
//int num=Integer.parseInt(num);
String username=request.getParameter("username");
String password=request.getParameter("password");
String ssn=(String)session.getAttribute("ssn");
//Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con1=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","Amanrash","Amanrash");
PreparedStatement ps1=con1.prepareStatement("Select * from customer where userid='"+username+"' and password='"+password+"' and ssn='"+ssn+"'");
ResultSet rs1=ps1.executeQuery();
//Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con2=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","Amanrash","Amanrash");
PreparedStatement ps2=con2.prepareStatement("Select * from new_account where account_no="+accountno+"");
ResultSet rs2=ps2.executeQuery();
if(rs1.next()&&rs2.next()){
status=true;
}
//if(status==true){
// out.print("Welcome " + username);
try {
if(status==true){
out.print("Welcome " + username);
//Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","Amanrash","Amanrash");
PreparedStatement ps=con.prepareStatement("Select * from NEW_ACCOUNT where account_no=?");
ps.setLong(1,accountno);
ResultSet rs=ps.executeQuery();
out.print("<table align='left' cellspacing='5' cellpadding='5'>");
out.print("<tr><th>USER ID</th><th>ACCOUNT NO</th><th>ACCOUNT TYPE</th><th>AMOUNT</th><th>SSN</th></tr>");
while(rs.next()){
int accountno1=rs.getInt(1);
session.setAttribute("accountno",accountno1);
out.print(accountno);
out.print("<tr>");
out.print("<td>" +username+ "</td>");
out.print("<td>" + rs.getInt(1) + "</td>");
out.print("<td>" + rs.getString(2) + "</td>");
out.print("<td>" + rs.getInt(3) + "</td>");
out.print("<td>" +ssn+ "</td>");
out.print("</tr>");
}
out.print("</table>");
Random r=new Random();
int tid=r.nextInt(123456789);
//Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con3=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","Amanrash","Amanrash");
PreparedStatement ps3=con3.prepareStatement("insert into transaction values(?)");
ps3.setInt(1,tid);
int status3=ps3.executeUpdate();
out.println(status3);
}
else{
out.print("Please check
your username and Password");
request.setAttribute("balance","Please check your username and Password");
%>
<jsp:forward page="balance1.jsp"></jsp:forward>
<%
}
}catch (Exception e) {
e.printStackTrace();
}
//}
//}
%></table><%
%>
</table>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*" %>
<%@ page import="javax.servlet.*"%>
<%@ page import="java.util.*"%>
request.setAttribute("balance","Please check your username and Password");
%>
<jsp:forward page="balance1.jsp"></jsp:forward>
<%
}
}catch (Exception e) {
e.printStackTrace();
}
//}
//}
%></table><%
%>
</table>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*" %>
<%@ page import="javax.servlet.*"%>
<%@ page import="java.util.*"%>