一个JSP做的聊天室,有点丑,不过要以学习一下

源代码在线查看: chatreg.java

软件大小: 51 K
上传用户: dan_che
关键词: JSP
下载地址: 免注册下载 普通下载 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;
				}
				}
							

相关资源