📄 firstclass.java
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package MyPackage;import java.sql.SQLException;import java.util.Date;/** * * @author @n@ */public class FirstClass { private String mainString; private String userId; private String fName; private String lName; private String phNo; Date date= new Date(); private int intCounter; Manager mg = null; public FirstClass () { mg = new Manager(); }//********** getter and setter ***********************************************// public String getMainString() { return mainString; } public void setMainString(String mainString) { this.mainString = mainString; } public int getIntCounter() { return intCounter; } public void setIntCounter(int intCounter) { this.intCounter = intCounter; } //**************************************************************************// public String save() throws SQLException { String[] temporary=null; String[] temp; String[] temp1 = null; String del = ","; String del1 = ":"; temporary =getMainString().split(":"); String user; user =temporary[0]; mg.CheckCurrentDateData(user, date); temp = getMainString().split(del); intCounter = temp.length; for (int i =0; i<temp.length-1; i++) { temp1 = temp[i].split(del1); userId = temp1[0]; fName = temp1[1]; lName = temp1[2]; phNo = temp1[3]; mg.insertValue(userId, fName, lName, phNo, date); } System.out.println("Data saved successfully in back_up"); return "SUCCESS"; } public String saveInBackDate() throws SQLException { String[] temp; String temp1 = ""; String del = ":"; temp = getMainString().split(del); temp1 = temp[0]; mg.insertInBackDate(temp1, date); System.out.println("Data saved successfully in back_date"); return "SUCCESS"; } public String save1() throws SQLException { String[] temp; String[] temp1 = null; String del = ","; String del1 = ":"; temp = getMainString().split(del); for (int i =0; i<temp.length-1; i++) { temp1 = temp[i].split(del1); userId = temp1[0]; fName = temp1[1]; lName = temp1[2]; phNo = temp1[3]; mg.insertValue1(userId, fName, lName, phNo, date); } System.out.println("Data saved successfully in temp"); return "SUCCESS"; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -