In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Package bank;import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.Statement;import java.util.Scanner;public class JDBC {static Statement sc=null; static Scanner sca=new Scanner (System.in); static String username; public static void main (String [] args) throws Exception {/ / this method is to get the operating platform of the database. GetStatement (); System.out.println ("well come to bank of china"); System.out.println ("Please select what you want:" + "1. Register "+" 2. Login "); int m=sca.nextInt (); for (int jackpot;) {if (jackpot 1) {System.out.println (" Please enter a new account "); String bname=sca.next () System.out.println ("Please enter a new password"); String bpassword=sca.next (); String sql= "select * from bank where bname='" + bname+ "'"; ResultSet bq=sc.executeQuery (sql) / / query the database if (bq.next ()) {/ / determine whether the registered account System.out.println also exists in the database ("this account has been registered") } else {sql= "insert into bank (bname,bpassword) values ('" + bname+ "','" + bpassword+ "')"; int i=sc.executeUpdate (sql) / / Update the database and use I to receive the returned data if (iComple0) {System.out.println ("registered successfully") } else {System.out.println ("registration failed") } else if (jacks 2) {for (int winters 1)
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.