简单实现的一个登录模块

源代码在线查看: dbconn.java

软件大小: 6 K
上传用户: xushenghao001
关键词: 模块
下载地址: 免注册下载 普通下载 VIP

相关代码

				
				//DBConn.java
				
				//include required classes
				import java.sql.*;
				
				//==========================================
				// Define Class DBConn
				//==========================================
				public class DBConn
				{
					public String sql_driver = "org.gjt.mm.mysql.Driver";
					public String sql_url = "jdbc:mysql://localhost:3306";
					public String sql_DBName = "shopping";
					public String user = "sa";
					public String pwd = "";
				
					Connection conn = null;
					Statement stmt = null;
					ResultSet rs = null;
				
					public boolean setDriver(String drv)
					{
						this.sql_driver = drv;
						return true;
					}
				
					public String getDriver()
					{
						return this.sql_driver;
					}
				
					public boolean setUrl(String url)
					{
						this.sql_url = url;
						return true;
					}
				
					public boolean setDBName(String dbname)
					{
						this.sql_DBName = dbname;
						return true;
					}
				
					public String getDBName()
					{
						return this.sql_DBName;
					}
				
					public boolean setUser(String user)
					{
						this.user = user;
						return true;
					}
				
					public String getUser()
					{
						return this.user;
					}
				
					public boolean setPwd(String pwd)
					{
						this.pwd = pwd;
						return true;
					}
				
					public String getPwd()
					{
						return this.pwd;
					}
				
					public DBConn()
					{
						try{
							Class.forName(sql_driver);//加载数据库驱动程			

相关资源