Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The connection between ATM and Database Mysql in java

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Import java.sql.*

Import java.util.*

Public class ATM1 {

String code

Int pass

Double money

Int iTunes 1

/ / check login

Public void checkLogin () {

Int iTunes 1

While (imoney) {

System.out.println ("your balance is insufficient!")

Qukuan ()

} else {

Money=money-money2

SaveDb ()

System.out.println ("balance on your card is:" + money)

System.out.println ("Please keep your cash!")

LoadSys ()

}

}

/ / change the password

Public void xiugai () {

Int cs = 0

System.out.print ("Please enter original password:")

Scanner mm=new Scanner (System.in)

Int pass1=mm.nextInt ()

System.out.print ("Please enter new password:")

Int pass2=mm.nextInt ()

System.out.print ("Please enter the new password again:")

Int pass3=mm.nextInt ()

If (pass==pass1&& pass2==pass3) {

System.out.println ("password changed successfully!")

Pass=pass2

SaveDb ()

LoadSys ()

} else {

If (cs

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report