资源简介
本文是题为民航管理售票系统的数据库系统,含有代码实现
代码片段和文件信息
package qxz;
import java.sql.*;
import javax.swing.JComboBox;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
public class Database {
public static Connection cn;
public static Statement st;
public static Statement st2;
public static ResultSet rs;
public static String dbms;
// below for SQL Server
static String user = ConfigIni.getIniKey (“UserID“);
static String pwd = ConfigIni.getIniKey (“Password“);
static String ip = ConfigIni.getIniKey (“IP“);
static String acc = ConfigIni.getIniKey (“Access“);
static String dbf = ConfigIni.getIniKey (“Database“);
// below for Oracle
static String UID=ConfigIni.getIniKey (“UID“);
static String Passd=ConfigIni.getIniKey (“Passd“);
static String Server=ConfigIni.getIniKey (“Server“);
static String DB=ConfigIni.getIniKey (“DB“);
static String Port=ConfigIni.getIniKey (“Port“);
// below for MySQL
static String UID2=ConfigIni.getIniKey (“UID2“);
static String Passd2=ConfigIni.getIniKey (“Passd2“);
static String Server2=ConfigIni.getIniKey (“Server2“);
static String DB2=ConfigIni.getIniKey (“DB2“);
static String Port2=ConfigIni.getIniKey (“Port2“);
// below for PostgreSQL
static String UID3=ConfigIni.getIniKey (“UID3“);
static String Passd3=ConfigIni.getIniKey (“Passd3“);
static String Server3=ConfigIni.getIniKey (“Server3“);
static String DB3=ConfigIni.getIniKey (“DB3“);
static String Port3=ConfigIni.getIniKey (“Port3“);
static {
try {
if(ConfigIni.getIniKey (“Default_link“).equals (“1“)) {//JDBC--SQL Server 2005
DriverManager.registerDriver (new com.microsoft.sqlserver.jdbc.SQLServerDriver()); //注册驱动
String url=“jdbc:sqlserver://“+ip+“:“+acc+“;“+“databasename=“+dbf;//获得一个连接
cn = DriverManager.getConnection (url user pwd);
dbms=“SQL Server“;
}
else if(ConfigIni.getIniKey (“Default_link“).equals (“2“)) {//JDBC-SQL Server 2000
DriverManager.registerDriver (new com.microsoft.jdbc.sqlserver.SQLServerDriver()); //注册驱动
String url = “jdbc:microsoft:sqlserver://“ + ip + “:“ + acc + “;“ + “databasename=“ + dbf; //获得一个连接
cn = DriverManager.getConnection (url user pwd);
dbms=“SQL Server“;
}
else if(ConfigIni.getIniKey (“Default_link“).equals (“4“)) {//JDBC-ODBC to Oracle
DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
cn = DriverManager.getConnection (“jdbc:odbc:“+ConfigIni.getIniKey(“linkNameORA“).trim()UIDPassd); //获得一个连接
dbms=“Oracle“;
}
else if(ConfigIni.getIniKey (“Default_link“).equals (“5“)) {//JDBC to Oracle
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
String url = “jdbc:oracle:thin:@“+Server+“:“+Port+“:“+DB;
cn =DriverManager.getConnection (url UID Passd);
dbms=“Oracle“;
}
else if(ConfigIni.getIniKey(“Default_link“).equals (“6“)) {//JDBC to MySQL
try { Class.forName(“com.mysql.jdbc.Driver“).newInstance();
} catch (Exception ex) { }
String ur
相关资源
- 美食天下项目Android版源码和Web版源码
- java代码编写将excel数据导入到mysql数据
- JAVA828436
- java 企业销售管理系统
- 基于JSP的学生宿舍管理系统(源码 数
- JSP学生信息管理系统 Mysql数据库
- android通过JDBC连接Mysql数据库
- java数据库连接(所有的数据库都支持
- 数据库设备管理系统课程设计论文J
- jsp与SQL Server数据库实现的客户注册登
- java sql2000员工管理系统数据库、文档
- java数据库版学生成绩管理系统
- java web学生管理系统(源码+数据库+截
- JavaWeb停车场管理系统(源代码,数据
- Java Web实现的易买网系统网站(源码
- 简单的登录页面,实现增删改查(运
- 物流管理系统源码(含数据库)5624
- jsp模拟酷狗官网源码(附数据库)
- 一个完整的点餐微信小程序(附后台
- 基于 struts 的学生寝室管理系统的设计
- 煤矿安全管理系统(jsp源码+数据库脚
- 基于JSP实现的美食餐饮管理系统(源
- 都市供求信息网(源码+数据库+文档)
- 图书管理系统(源码+数据库+截图)
- 学生信息管理系统源码+mysql数据库
- javaweb网上购物系统源码(附数据库脚
- jsp+servlet+jdbc开发学生信息后台管理系
- JSP选课系统(源码+文档+数据库)
- 基于JSP的超市销售管理系统(源码+
- jsp宠物商店(源码+数据库)
评论
共有 条评论