-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMiniStatement.java
54 lines (44 loc) · 1.71 KB
/
MiniStatement.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package bank.management.system;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class MiniStatement extends JFrame{
MiniStatement(String pinnumber){
setLayout(null);
JLabel bank=new JLabel("Indian Bank");
bank.setBounds(150,20,100,20);
add(bank);
JLabel card=new JLabel();
card.setBounds(20,80,300,20);
add(card);
JLabel mini=new JLabel();
mini.setBounds(20,140,400,200);
add(mini);
try{
Conn conn=new Conn();
ResultSet rs=conn.s.executeQuery("select * from login where pin ='"+pinnumber+"'");
while(rs.next()){
card.setText("Card Number:"+rs.getString("cardnumber").substring(0,4)+"XXXXXXXX"+rs.getString("cardnumber").substring(12));
}
}catch(Exception e){
System.out.print(e);
}
try{
Conn conn=new Conn();
ResultSet rs=conn.s.executeQuery("select * from bank where pin ='"+pinnumber+"'");
while(rs.next()){
mini.setText(mini.getText()+"<html>"+rs.getString("date")+" "+rs.getString("type")+" "+rs.getString("amount")+"<br><br> </html>");
}
}catch(Exception e){
System.out.println(e);
}
setSize(400,600);
setLocation(20,20);
getContentPane().setBackground(Color.WHITE);
setVisible(true);
}
public static void main(String args[]){
new MiniStatement("");
}
}