资源简介
PHPopen-lims-master.zip

代码片段和文件信息
package base;
import io.DBConfig;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
/**
* Basic Database IO.
* @author Roman Quiring
*/
public class Dblink
{
private static String dbms = DBConfig.get_config(“dbms“);;
private static String sqlDriver = DBConfig.get_config(“sqlDriver“);;
private static String dbServer = DBConfig.get_config(“dbServer“);
private static String dbPort = DBConfig.get_config(“dbPort“);
private static String dbName = DBConfig.get_config(“dbName“);;
private static String dbUser = DBConfig.get_config(“dbUser“);;
private static String dbPassword = DBConfig.get_config(“dbPassword“);;
/**
* Static constructor.
*/
static
{
initDB();
}
/**
* Initialises the connection to the Database.
*/
private static void initDB() {
try
{
Class.forName(sqlDriver);
}
catch (ClassNotFoundException e)
{
System.err.println(“JDBC driver could not be found!“);
e.printStackTrace();
return;
}
Connection connection = getDBConnection();
try
{
connection.close();
}
catch (SQLException e)
{
System.err.println(“An error occurred while establishing a connection to the database!“);
e.printStackTrace();
}
}
/**
* Returns a Connection object.
* @return Connection the connection object.
*/
private static Connection getDBConnection() {
Connection connection = null;
try
{
connection = DriverManager.getConnection(“jdbc:“+dbms+“://“+dbServer+“:“+dbPort+“/“+dbName dbUser dbPassword);
}
catch (SQLException e)
{
System.err.println(“Connection to database failed! Make sure the specifications in the config file are correct.“);
e.printStackTrace();
}
return connection;
}
/**
* Executes a SQL Statement on the database.
* @param sql the SQL statement.
* @return a ResultSet containing the results.
*/
public static ResultSet executeQuery(String sql)
{
ResultSet results = null;
Connection connection = getDBConnection();
try
{
Statement statement = connection.createStatement();
results = statement.executeQuery(sql);
connection.close();
}
catch (SQLException e)
{
e.printStackTrace();
}
return results;
}
/**
* Executes a SQL Update on the database.
* @param sql the SQL statement.
*/
public static void updateQuery(String sql)
{
Connection connection = getDBConnection();
try
{
Statement statement = connection.createStatement();
statement.executeUpdate(sql);
connection.close();
}
catch (SQLException e)
{
e.printStackTrace();
}
}
/**
* Executes a SQL Statement on the database and accepts additional parameters-
* @param sql the SQL statement.
* @param type FORWARD_ONLY SCROLL_SENSITIV
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-03-30 13:23 open-lims-master\
文件 31 2017-03-30 13:23 open-lims-master\.gitignore
文件 32069 2017-03-30 13:23 open-lims-master\LICENSE
文件 160 2017-03-30 13:23 open-lims-master\README
目录 0 2017-03-30 13:23 open-lims-master\filesystem\
目录 0 2017-03-30 13:23 open-lims-master\filesystem\groups\
目录 0 2017-03-30 13:23 open-lims-master\filesystem\groups\1\
文件 34 2017-03-30 13:23 open-lims-master\filesystem\groups\1\placeholder.txt
目录 0 2017-03-30 13:23 open-lims-master\filesystem\groups\10\
文件 34 2017-03-30 13:23 open-lims-master\filesystem\groups\10\placeholder.txt
目录 0 2017-03-30 13:23 open-lims-master\filesystem\groups\11\
文件 34 2017-03-30 13:23 open-lims-master\filesystem\groups\11\placeholder.txt
目录 0 2017-03-30 13:23 open-lims-master\filesystem\groups\2\
文件 34 2017-03-30 13:23 open-lims-master\filesystem\groups\2\placeholder.txt
目录 0 2017-03-30 13:23 open-lims-master\filesystem\groups\9\
文件 34 2017-03-30 13:23 open-lims-master\filesystem\groups\9\placeholder.txt
目录 0 2017-03-30 13:23 open-lims-master\filesystem\organisation_units\
文件 34 2017-03-30 13:23 open-lims-master\filesystem\organisation_units\placeholder.txt
目录 0 2017-03-30 13:23 open-lims-master\filesystem\projects\
文件 34 2017-03-30 13:23 open-lims-master\filesystem\projects\placeholder.txt
目录 0 2017-03-30 13:23 open-lims-master\filesystem\samples\
文件 34 2017-03-30 13:23 open-lims-master\filesystem\samples\placeholder.txt
目录 0 2017-03-30 13:23 open-lims-master\filesystem\temp\
文件 34 2017-03-30 13:23 open-lims-master\filesystem\temp\placeholder.txt
目录 0 2017-03-30 13:23 open-lims-master\filesystem\templates\
目录 0 2017-03-30 13:23 open-lims-master\filesystem\templates\OLDL\
文件 34 2017-03-30 13:23 open-lims-master\filesystem\templates\OLDL\placeholder.txt
目录 0 2017-03-30 13:23 open-lims-master\filesystem\templates\OLVDL\
文件 34 2017-03-30 13:23 open-lims-master\filesystem\templates\OLVDL\placeholder.txt
目录 0 2017-03-30 13:23 open-lims-master\filesystem\users\
目录 0 2017-03-30 13:23 open-lims-master\filesystem\users\1\
............此处省略2860个文件信息
- 上一篇:php实用指南PHP电子书
- 下一篇:.zip 源码
相关资源
- 直链王-自动上链
- 好用的php微信企业号
- php小说采集demo
- 韩顺平 PHP从入门到精通百度云资源(
- Xblog、PHPwind、Oblog三款主流商用博客软
- ZipFile.php(PHP压缩类打包)
- PHP支持手势的手机端图片裁剪上传
- vip影视源码自动无需采集THINKPHP版
- Delphi微信支付SDKD7~XE10通用
- php大马一句话数据库集合
- thinkphp 在线电子手写签名 已分离出
- thinkphp简易抢红包.rar
- php-7-data-structures-algorithms.rar
- zw_qq1124794084-9971392-phpcms_v9.6.0_UTF8.zip
- 热搜视频解析,VIP视频解析网站源码
-
Phpcmsv9.3.6ba
seUE4Fix.zip - php+mysql+apache的图书管理系统.rar
- phpmysql.zip
- zw_kiwisyslogserverwithphpwebview.zip
- phpdisk3.5网赚破解版.rar
- 最新阿狸子订单系统V2.4.2豪华版PHP订
- 网上书城系统(PHP+MYSQL).zip
- php+mysql学生成绩查询系统.zip
- lfcms_php.zip
- 云呼服务器源码phpAPK正版授权云呼系
- HP_10bii_EMU_20121210.zip
- 基于PHP的图书借阅管理系统.zip
- php无限级分类实现评论及回复.rar
- PHP报价计算器仿土巴兔.7z
- wfphp订单系统,商业破解版,php源码,
评论
共有 条评论