java 的程序集合,会节省你很多时间的,有两个包.

源代码在线查看: chatreg.java

软件大小: 1000 K
上传用户: lkconan
关键词: java 程序
下载地址: 免注册下载 普通下载 VIP

相关代码

				package test;
				import java.sql.*;
				
				public class  chatreg{
				String sDBDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
				String sConnStr = "jdbc:odbc:chatreg";
				Connection conn = null;
				ResultSet rs = null;
				
				public chatreg() {
				try {
				Class.forName(sDBDriver); 
				}
				catch(java.lang.ClassNotFoundException e) {
				System.err.println("chatreg(): " + e.getMessage());
				}
				}
				
				public ResultSet executeQuery(String sql) {
				rs = null;
				try {
				conn = DriverManager.getConnection(sConnStr); 
				Statement stmt = conn.createStatement();
				rs = stmt.executeQuery(sql);
				} 
				catch(SQLException ex) { 
				System.err.println("aq.executeQuery: " + ex.getMessage());
				}
				return rs;
				}
				}
							

相关资源