亲情通讯录小程序有什么用?怎么开发?
最近有很多人开始讨论亲情通讯录,了解之后才知道这是小程序新推出的功能,那么亲情通讯录小程序有什么用呢?要怎么开发?以下是小编为大家带来的资料。
亲情通讯录小程序有什么用:
1、实现多方通话,避免一个一个手机号手动输入。
2、用户可以给不同的人进行小程序会话管理,让你的人际交流更加高效。
3、让自己的亲友也了解并使用小程序,从中获取便利之处。
亲情通讯录小程序怎么开发:
package com.TongXunLu.services;
import java.util.Scanner;
import com.TongXunLu.Add.AddMenu;
import com.TongXunLu.Delete.DeleteMenu;
import com.TongXunLu.Select.SelectMenu;
import com.TongXunLu.Update.UpdateMenu;
public class App {
public static void main(String[] args) {
//欢迎进入系统
Welcome();
}
public static void Welcome(){
System.out.println("*********************");
System.out.println("** 1 添加纪录 **");
System.out.println("** 2 查找记录 **");
System.out.println("** 3 修改记录 **");
System.out.println("** 4 删除记录 **");
System.out.println("** 5 排序记录 **");
System.out.println("** 6 退出系统 **");
System.out.println("*********************");
System.out.println("请输入正确的数字,最小是:1,最大是:6");
Scanner input=new Scanner(System.in);
int sel=input.nextInt();
switch (sel) {
case 1:
//添加纪录
AddMenu.Add();
break;
case 2:
//查找记录
SelectMenu.Select();
break;
case 3:
//修改记录
UpdateMenu.menu ();
break;
case 4:
DeleteMenu.menu();
break;
case 5:
//排序记录
CompartorMenu.menu();
break;
case 6:
System.out.println("系统退出!");
System.exit(0);
break;
}
}
}
package com.TongXunLu.Add;
import java.util.List;
import java.util.Scanner;
import com.TongXunLu.Select.SelectAll;
import com.TongXunLu.services.App;
import com.TongXunLu.services.Person;
public class AddMenu {
//添加纪录菜单
public static void Add(){
System.out.println("*********************");
System.out.println("** 1 添加新纪录 **");
System.out.println("** 2 查看全纪录 **");
System.out.println("** 3 返回上一级 **");
System.out.println("请输入正确的数字,最小是:1,最大是:3");
Scanner input=new Scanner(System.in);
int AddSel=input.nextInt();
switch (AddSel) {
case 1:
//添加新纪录
AddServices addPerson=new AddImplement();
addPerson.AddPerson();
break;
case 2:
//查看全记录
List list=SelectAll.SelectAllPerson();
for (Person p : list) {
System.out.println(p.toString());
}
Add();
break;
case 3:
//返回上一级
App.Welcome();
break;
}
}
}
package com.TongXunLu.Add;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Scanner;
import com.TongXunLu.tools.TelNoteRegex;
import com.TongXunLu.tools.Tools;
public class AddImplement implements AddServices{
@Override
public void AddPerson() {
Scanner input=new Scanner(System.in);
String name=null;
int age=0;
String sex=null;
String TelNum=null;
String address=null;
boolean b=false;
while(b==false){
System.out.println("输入姓名,1-10位字母");
name=input.next();
b=TelNoteRegex.CheckName(name,b);
}
b=false;
while(b==false){
System.out.println("输入年龄,1-200");
age=input.nextInt();
b=TelNoteRegex.CheckAge(age, b);
}
b=false;
while(b==false){
System.out.println("输入*别,(男 m or M)(女 f or F)");
sex=input.next();
b=TelNoteRegex.CheckSex(sex, b);
}
b=false;
while(b==false){
System.out.println("输入电话号码,6-10位数字");
TelNum=input.next();
b=TelNoteRegex.CheckTel(TelNum, b);
}
b=false;
while(b==false){
System.out.println("输入地址,1-50位字母或数字");
address=input.next();
b=TelNoteRegex.CheckAddress(address, b);
}
//获取连接 驱动
Connection conn=null;
PreparedStatement pstm=null;
conn=Tools.getConnection();
try {
pstm=conn.prepareStatement("insert into person(id,name,age,sex,telnum,address)values (person_sequence.nextval,?,?,?,?,?)");
pstm.setString(1, name);
pstm.setInt(2, age);
pstm.setString(3, sex);
pstm.setString(4, TelNum);
pstm.setString(5, address);
if(pstm.executeUpdate()>0){
System.out.println("添加成功!");
}
AddMenu.Add();
} catch (SQLException e) {
// e.printStackTrace();
System.out.println("输入错误!请重新输入");
AddPerson();
}finally{
Tools.Close(pstm);
Tools.Close(conn);
}
}
上文中详细介绍了亲情通讯录小程序有什么用,也告诉大家小程序亲情通讯录的开发方式,希望能够对大家有所帮助,如果还想了解更多相关信息请在微信小程序商店搜索。
微信小程序可视化设计工具有什么用?
微信小程序表单组件都有哪些?都有什么用?
小程序直播功能是什么?小程序直播有什么用?