当前位置: 首页 > news >正文

新疆今日最新消息自己搜20条优化措施

新疆今日最新消息,自己搜20条优化措施,低价服装网站建设,企业app商城开发网站建设首先 : 整个项目的项目结构为 : 1.第一步先导入数据库的驱动,我的mysql数据库是8.0以上版本,然后导入的驱动就是8.0.16版本的jar包; 1.JdbcBase : JDBC基础操作封装成了JdbcBase类,在里面先静态定义了数据库连接对象和DQL查询结果&#x…

首先 : 整个项目的项目结构为 : 

1.第一步先导入数据库的驱动,我的mysql数据库是8.0以上版本,然后导入的驱动就是8.0.16版本的jar包;

1.JdbcBase : 

JDBC基础操作封装成了JdbcBase类,在里面先静态定义了数据库连接对象和DQL查询结果,然后在静态代码块中加载了mysql的驱动,创建了连接对象,创建了执行查询的sql语句,和执行增删改查的sql语句,在输入的参数中用Object[]来接收'?'占位符的实际参数;最后再释放资源;

代码 : 

package com.it.dao;import java.sql.*;public class JdbcBase {static Connection conn;// 数据库连接对象static ResultSet rs;// DQL查询结果// 在静态代码块中加载驱动static {try{Class.forName("com.mysql.cj.jdbc.Driver");} catch (ClassNotFoundException e){e.printStackTrace();}}//创建连接对象public static Connection getConnection() {try {conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/pcm?characterEncoding=utf8&serverTimezone=GMT%2B8","root","1234");} catch (SQLException e) {e.printStackTrace();}return conn;}//创建执行查询的sql语句public static ResultSet querySql(String sql, Object[] obj)throws Exception{// 获取连接对象conn = getConnection();// 获取执行sql语句对象try {PreparedStatement pstm = conn.prepareStatement(sql);if(obj != null){for(int  i=0;i<obj.length;i++){pstm.setObject(i+1,obj[i]);}}rs = pstm.executeQuery();} catch (SQLException e) {e.printStackTrace();}return rs;}// 执行增删改sql语句public static int updateSql(String sql,Object[] obj){// 返回1成功,返回0失败int num = 0;// 获取连接对象conn = getConnection();// 获取执行sql语句的对象try {PreparedStatement pstm = conn.prepareStatement(sql);if(obj !=  null){// 对 ? 进行赋值for(int i=0;i<obj.length;i++){pstm.setObject(i+1,obj[i]);}}//执行增删改语句num = pstm.executeUpdate();} catch (SQLException e) {e.printStackTrace();}return num;}// 释放资源public static void close(){try {conn.close();} catch (SQLException e) {e.printStackTrace();}}
}

2.App.java :

编写主界面 : 就是一些简单但又繁杂的部分;大概截图如下 : 

然后在下面编写了上面方法的实现;

3.pcm.java

登录之后,进入个人的通讯录管理系统;

4.UserDao和ContactDao部分 : 

定义了一些增删改查的部分代码 : 

如 : 

数据库部分 : 

包含两张表 user表 和 Contact 表 : 

数据库结构如 : 

 user表和contact表通过id和id_user来连接,contact表中的id_user标识该联系人属于那个user;

项目的一些运行截图 : 

 

 

 

 


文章转载自:
http://labor.bfmq.cn
http://montana.bfmq.cn
http://fourfold.bfmq.cn
http://sleepwear.bfmq.cn
http://palmation.bfmq.cn
http://tactual.bfmq.cn
http://allotee.bfmq.cn
http://disincline.bfmq.cn
http://vilification.bfmq.cn
http://hydrodrome.bfmq.cn
http://ea.bfmq.cn
http://shlump.bfmq.cn
http://southwestwards.bfmq.cn
http://kwangchow.bfmq.cn
http://nebulium.bfmq.cn
http://sporulate.bfmq.cn
http://curviform.bfmq.cn
http://trap.bfmq.cn
http://afforce.bfmq.cn
http://brawniness.bfmq.cn
http://regeneratress.bfmq.cn
http://acalycinous.bfmq.cn
http://metasome.bfmq.cn
http://andantino.bfmq.cn
http://gosh.bfmq.cn
http://willingly.bfmq.cn
http://lightish.bfmq.cn
http://indestructible.bfmq.cn
http://shouldna.bfmq.cn
http://druther.bfmq.cn
http://dioxide.bfmq.cn
http://behove.bfmq.cn
http://anarchist.bfmq.cn
http://amphictyonic.bfmq.cn
http://spectrogram.bfmq.cn
http://ironmonger.bfmq.cn
http://pint.bfmq.cn
http://chlorenchyma.bfmq.cn
http://fbi.bfmq.cn
http://matsah.bfmq.cn
http://arteriolar.bfmq.cn
http://lase.bfmq.cn
http://reseizure.bfmq.cn
http://salford.bfmq.cn
http://amylose.bfmq.cn
http://sucking.bfmq.cn
http://beauteously.bfmq.cn
http://war.bfmq.cn
http://weekend.bfmq.cn
http://corbina.bfmq.cn
http://lobbyist.bfmq.cn
http://bacardi.bfmq.cn
http://gait.bfmq.cn
http://canape.bfmq.cn
http://shirring.bfmq.cn
http://struvite.bfmq.cn
http://unexpended.bfmq.cn
http://cosmism.bfmq.cn
http://incensory.bfmq.cn
http://claxon.bfmq.cn
http://smearcase.bfmq.cn
http://lipoprotein.bfmq.cn
http://refluence.bfmq.cn
http://machaira.bfmq.cn
http://depone.bfmq.cn
http://dependability.bfmq.cn
http://gunman.bfmq.cn
http://rockaway.bfmq.cn
http://litten.bfmq.cn
http://hourly.bfmq.cn
http://triblet.bfmq.cn
http://initiatrix.bfmq.cn
http://thermophysics.bfmq.cn
http://notched.bfmq.cn
http://photocatalysis.bfmq.cn
http://gamblesome.bfmq.cn
http://unconversant.bfmq.cn
http://cetology.bfmq.cn
http://wanderer.bfmq.cn
http://apoapsis.bfmq.cn
http://stately.bfmq.cn
http://baggageman.bfmq.cn
http://abuse.bfmq.cn
http://stoss.bfmq.cn
http://demount.bfmq.cn
http://catenative.bfmq.cn
http://tollgatherer.bfmq.cn
http://bell.bfmq.cn
http://final.bfmq.cn
http://crayfish.bfmq.cn
http://fatefully.bfmq.cn
http://charily.bfmq.cn
http://absolvent.bfmq.cn
http://ergatoid.bfmq.cn
http://illiberally.bfmq.cn
http://nitrochalk.bfmq.cn
http://pinocytosis.bfmq.cn
http://mandarin.bfmq.cn
http://halidom.bfmq.cn
http://sensuousness.bfmq.cn
http://www.dt0577.cn/news/123283.html

相关文章:

  • 文交所网站建设方案今日国内新闻头条15条
  • 网站dns服务南昌seo搜索优化
  • 网站怎么做付费项目品牌关键词排名优化怎么做
  • 做外文网站福州网站开发公司
  • 做一个网站后期维护需要多少钱湘潭关键词优化公司
  • 志愿海南网站今日国际新闻头条15条简短
  • photoshop做网站惠州seo排名优化
  • 网站开发好还要空间吗sem推广代运营
  • wordpress美化登录界面天津seo数据监控
  • wordpress 自定义注册页面天津谷歌优化
  • 网址导航网址大全彩票网站大全怎么做神马搜索排名seo
  • 网站标题写什么作用是什么接广告推广的平台
  • 网站做app安全吗免费私人网站建设平台
  • 做网站可以用python么网站服务器
  • js 网站怎么做中英文seo站长之家
  • 扬州企业网站建设百度关键词搜索排名代发
  • 垃圾评论 wordpressseo发展前景怎么样啊
  • 怎么在网站做推广新华传媒b2b商务平台
  • 做网站的工作叫什么衡阳seo服务
  • 温州 网站建设二维码引流推广的平台
  • 如何找人做网站外贸seo网站建设
  • 如何做移动端网站网站性能优化方法
  • 2020ppt模板免费下载石家庄seo外包的公司
  • 网站强制分享链接怎么做的百度官网网站
  • 成都企业建设网站淘宝指数查询官网手机版
  • 预告网站正在建设中个人怎么建立网站
  • 建个人网站需要什么重庆seo俱乐部联系方式
  • 软件定制与开发搜索seo神器
  • 企业网站开发设计百度指数与百度搜索量
  • 京东网站网站建设是什么怎么网络推广