网络彩讯既然是通过云平台实现滴,那当然需要数据的存储以及文件的存储了。
对于本地,什么数据库都没使用到,仅仅是下载的彩讯会保存到本地,而发送的在发送完后都在本地删除了、
下面就来见识见识云平台数据的传输吧,在速度上,本人经测试是一般网络速度的两倍多点吧、
核心类:
需要x5cloud云平台提供的账号,就像你看到的16个8
然后是数据库的选择:看那个1,代表的是mysql
接着是你创建的数据库:比如Android_CX
最后出场的,也是最重要的服务器域名了:看吧,service.x5cloud.com
public class DataBase { private static String userid="8888888888888888"; private static int dbtype=1; private static String dbname="Android_CX"; private static String serverip="service.x5cloud.com"; private static List<String> sql=new ArrayList<String>(); public void clearSql() { sql.clear(); } public List<String> getSql() { return sql; } public void addSql(String elsql){ sql.add(elsql); } public boolean doData(List<String> sql){ int istransaction=1; X5Persist x5=new X5Persist(userid,dbtype,dbname,serverip); boolean flag=false; try { flag = x5.x5job(sql,istransaction); } catch (X5Exception e) { System.out.println(e.getMessage()); e.printStackTrace(); } if(flag){ System.out.println("成功!"); } return flag; } public X5DBResult searchData(String sql){ X5Persist x5=new X5Persist(userid,dbtype,dbname,serverip); X5DBResult rs = null; try { rs = x5.select(sql); return rs; } catch (X5Exception e) { e.printStackTrace(); } return null; } public boolean handleDate(List<String> sql){ int istransaction=1; X5Persist x5=new X5Persist(userid,dbtype,dbname,serverip); boolean flag=false; try { flag = x5.x5job(sql,istransaction); } catch (X5Exception e) { System.out.println(e.getMessage()); e.printStackTrace(); } return flag; } }
好了,废话少说,看代码!
public boolean register(String name, String password, String code) { DataBase db = new DataBase(); String[] elsql = new String[10]; elsql[0] = "insert into users(Name,Password,CheckCode) values('" + name + "','" + password + "','" + code + "')"; db.addSql(elsql[0]); boolean BL = db.doData(db.getSql()); db.clearSql(); return BL; } public boolean checkData(String name, String str, int number) { DataBase db = new DataBase(); final String sql; if (number == 0) { sql = "select * from users where users.Name='" + name + "' and users.Password='" + str + "'"; } else { sql = "select * from users where users.Name='" + name + "' and users.CheckCode='" + str + "'"; } X5DBResult rs = db.searchData(sql); boolean BL = true; if (rs.hasNext()) BL = false; return BL; }
以上就是登录注册时和云平台接触的code,是不是非常简单!对!就是这么简单!
相关推荐
另外,彩讯与广州中国科学院软件应用技术研究所签订了产学研合作协议书,针对金融服务、电商服务、工业设计等产业(行业)和骨干企业的需求,开展大数据采集、存储、计算、分析、管理、安全、可视化展示等技术的研发...
彩讯55寸屏设置安装注意事项: 1.非专业人事安装:安装前请先关闭防火墙(如360安全卫士,瑞星,诺盾等),等安装完并且成功启动本软件后可重新开启防火墙。 2.专业人事安装:先把防火墙拦截自动处理功能改为询问...
300634_彩讯股份上市招股说明书.pdf
构建数据监测与梳理核心能力的网络可视化:浩瀚深度、中新赛克、恒为科 技、迪普科技等 对标 Palantir 的电子取证及数据溯源龙头:美亚柏科 通过微软 AEMSP 认证,专注于公有云运维及安全:云赛智联
300634彩讯股份财务报告资产负债利润现金流量表企业治理结构股票交易研发创新等1391个指标(2015-2022)
彩讯矩阵控制软件v2.0.exe
彩讯液晶DID拼接幕墙(2X3).pdf
中央控制系统方案 随着我国经济的迅猛发展,当前专业AV技术的突飞猛进,最近这几年来的表现尤为突出, 最明显的就是大屏幕投影显示设备的广泛而迅速的铺开,视迅会议、监控中心等自然不 在话下,在机场、街头、广场、...