资源简介
大学实训时候做的课程设计。java swing项目。里面包含数据库文件

代码片段和文件信息
package com.huaruiit.deal;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Vector;
import com.huaruiit.Jframe.denglu;
import com.huaruiit.Jframe.denglu;
public class DBUtil {
private final static String DRIVER = “com.mysql.jdbc.Driver“;
private final static String URL = “jdbc:mysql://localhost:3306/huaruiit_gamebox?characterEncoding=utf-8“;
private final static String USER = “root“;
private final static String PASSWORD = “123“;
static{
try {
Class.forName(DRIVER);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
//查询单个数据
public static ResultSet selectSingle(String sql)throws SQLException {
Connection connection = getcon();
Statement stmt = connection.createStatement();
return stmt.executeQuery(sql);
}
public static Connection getcon() throws SQLException
{
Connection connection = DriverManager.getConnection(URL USER PASSWORD);
return connection;
}
//查询商店游戏信息
public static Vectorject>> selectAllgame(){
//储存查询出来数据的空间
Vectorject>> data = new Vectorject>>();
try {
Connection connection = DBUtil.getcon();
String sql = “SELECT gameinfo_namegameinfo_pri FROM shop_gameinfo“;
//预编译
PreparedStatement ps = getPreparedStatement(connection sql null);
ResultSet resultSet = DBUtil.query(ps);
while(resultSet.next()){
Vectorject> obj = new Vectorject>();
obj.add(resultSet.getString(“gameinfo_name“));
obj.add(resultSet.getString(“gameinfo_pri“));
data.add(obj);
}
} catch (SQLException e) {
e.printStackTrace();
}
return data;
}
//查询用户游戏信息
public static Vectorject>> selectUserGameInfo(){
//储存查询出来数据的空间
Vectorject>> data = new Vectorject>>();
try {
Connection connection = DBUtil.getcon();
String sql = “SELECT * FROM “+denglu.loginuser+“_gameinfo“;
//预编译
PreparedStatement ps = getPreparedStatement(connection sql null);
ResultSet resultSet = DBUtil.query(ps);
while(resultSet.next()){
Vectorject> obj = new Vectorject>();
obj.add(resultSet.getString(“usergame_name“));
obj.add(resultSet.getString(“usergame_statu“));
data.add(obj);
}
} catch (SQLException e) {
e.printStackTrace();
}
return data;
}
//查询用户游戏分数信息
public static Vectorject>> selectUserScoreInfo(){
//储存查询出来数据的空间
Vectorject>> data = new Vectorject>>();
try {
Connection connection = DBUtil.getcon();
String sql = “SELECT * FROM user_score“;
//预编译
PreparedStatement ps = getPreparedStatement(connection sql null);
ResultSet resultSet = DBUtil.query(ps);
while(resultSet.next()){
Vectorject> obj = new Vectorject>();
obj.add(resultSet.getString(“user_n
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 379 2017-10-21 10:38 4+1GameBox\.classpath
文件 386 2017-10-27 11:02 4+1GameBox\.project
文件 598 2017-10-19 18:05 4+1GameBox\.settings\org.eclipse.jdt.core.prefs
文件 4538 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\DBUtil.class
文件 6395 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\Insertdata.class
文件 1617 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\shangjiayouxi$1.class
文件 753 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\shangjiayouxi$2.class
文件 3208 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\shangjiayouxi.class
文件 1825 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\showMessage.class
文件 936 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\xiugaimima$1.class
文件 1871 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\xiugaimima$2.class
文件 732 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\xiugaimima$3.class
文件 4426 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\xiugaimima.class
文件 2215 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\xiugai_tupian$1.class
文件 753 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\xiugai_tupian$2.class
文件 3365 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\xiugai_tupian.class
文件 2026 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\zhaohuimima$1.class
文件 741 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\zhaohuimima$2.class
文件 3286 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\zhaohuimima.class
文件 1046 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\zhuce$1.class
文件 2124 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\zhuce$2.class
文件 705 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\zhuce$3.class
文件 4484 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\deal\zhuce.class
文件 4629 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\game\Game.class
文件 456 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\game\GreedSnake.class
文件 9269 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\game\lianliankan.class
文件 8584 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\game\MyListener.class
文件 4117 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\game\MyPanel.class
文件 678 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\game\MyWindow$1.class
文件 2026 2017-10-27 11:02 4+1GameBox\bin\com\huaruiit\game\MyWindow.class
............此处省略214个文件信息
相关资源
- JAVA JSP公司财务管理系统 源代码 论文
- JSP+MYSQL旅行社管理信息系统
- 推荐算法的JAVA实现
- 基于Java的酒店管理系统源码(毕业设
- java-图片识别 图片比较
- android毕业设计
- java23种设计模式+23个实例demo
- java Socket发送/接受报文
- JAVA828436
- java界面美化 提供多套皮肤直接使用
- 在线聊天系统(java代码)
- 基于Java的图书管理系统807185
- java中实现将页面数据导入Excel中
- java 企业销售管理系统
- java做的聊天系统(包括正规课程设计
- Java编写的qq聊天室
- 商店商品管理系统 JAVA写的 有界面
- JAVA开发聊天室程序
- 在linux系统下用java执行系统命令实例
- java期末考试试题两套(答案) 选择(
- JAVA3D编程示例(建模、交互)
- Java 文件加密传输
- java做的房产管理系统
- 基于jsp的bbs论坛 非常详细
- [免费]java实现有障碍物的贪吃蛇游戏
- java Servlet投票实例
- 操作系统作业 (pv,作业管理,等5个
- 基于C/S架构考试系统(Java)
- java access 仓库管理系统 源码
- 一元多项式相加 java实现
评论
共有 条评论