📄 jinghuaconn.jad
字号:
// Decompiled by DJ v3.2.2.67 Copyright 2002 Atanas Neshkov Date: 2005-6-15 21:26:15
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: JinghuaConn.java
package jinghua;
import java.io.PrintStream;
import java.sql.*;
public class JinghuaConn
{
public static String getRootPath()
{
return rootpath;
}
public static String getChartPath()
{
return chartPath;
}
public JinghuaConn()
{
sample = "Sample";
con = null;
stmt = null;
rs = null;
Driver driver;
try
{
driver = (Driver)Class.forName("com.mysql.jdbc.Driver").newInstance();
}
catch(ClassNotFoundException e)
{
System.err.println("JinghuaConn():".concat(String.valueOf(String.valueOf(e.toString()))));
}
catch(Exception e)
{
System.err.println("JinghuaConn():".concat(String.valueOf(String.valueOf(e.toString()))));
}
}
public Connection getConnection()
{
try
{
String strUrl = "jdbc:mysql://localhost/jinghua?user=root&password=&useUnicode=true&characterEncoding=gb2312";
con = DriverManager.getConnection(strUrl);
}
catch(Exception e)
{
con = null;
}
return con;
}
public void dropConnection()
{
try
{
closeStmt();
con.close();
}
catch(Exception exception) { }
finally
{
con = null;
}
}
public ResultSet executeQuery(String sql)
{
rs = null;
try
{
con = getConnection();
stmt = con.createStatement();
rs = stmt.executeQuery(sql);
}
catch(SQLException ex)
{
System.err.println("JinghuaConn.executeQuery(): ".concat(String.valueOf(String.valueOf(ex.getMessage()))));
}
return rs;
}
public void executeUpdate(String sql)
{
stmt = null;
rs = null;
try
{
con = getConnection();
stmt = con.createStatement();
stmt.executeUpdate(sql);
stmt.close();
con.close();
}
catch(SQLException ex)
{
System.err.println("JinghuaConn:executeUpdate(): ".concat(String.valueOf(String.valueOf(ex.getMessage()))));
}
}
public void execute(String sql)
{
stmt = null;
rs = null;
try
{
con = getConnection();
stmt = con.createStatement();
stmt.execute(sql);
stmt.close();
con.close();
}
catch(SQLException ex)
{
System.err.println("JinghuaConn:execute(): ".concat(String.valueOf(String.valueOf(ex.getMessage()))));
}
}
public void closeStmt()
{
try
{
stmt.close();
}
catch(SQLException e)
{
e.printStackTrace();
}
}
public void closeConn()
{
try
{
con.close();
}
catch(SQLException e)
{
e.printStackTrace();
}
}
private static String rootpath = "D:\\JavaApp\\Jinghua\\test_online";
private static String chartPath = "D:\\JavaApp\\Jinghua\\test_online\\chart\\temp";
private String sample;
private Connection con;
private Statement stmt;
ResultSet rs;
private static final String DRIVER = "com.mysql.jdbc.Driver";
private static final String USERNAME = "root";
private static final String PASSWORD = "";
private static final String HOST = "http://localhost:8080";
private static final String PHYPATH = "D:/JavaApp/Jinghua/test_online";
private static final String CONNECTION_STRING = "jdbc:mysql://localhost/jinghua";
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -