日期:2014-05-16  浏览次数:20386 次

JSP实现MySQL数据结构查询
流程简介:

                                 login                                use                    describe

                    登录<----------->选择数据库<--------->选择表<---------->显示表结构

                                logout                              back                      back

0.数据库处理的javabean:(我厚道吧,这都贴出来了)

MySQLmeans.java(位置:MySQL/mysqlmeans.java):

package MySQL;
import java.sql.*;
/**
*
* @author lucifer
*/

public class mysqlmeans {
     Connection con;
    String username = "";
    String passWord = "";
     String server = "";
     String dbname = "";
     public void setPRoperties(String serv,String db,String name,String pass){
          server = serv;
          dbname = db;
          username = name;
          password = pass;
     }

     public void setUserName(String username){
          this.username = username;
     }
     public String getUserName(){
          return username;
     }

     public void setPassword(String password){
          this.password = password;
     }
     public String getPassword(){
          return password;
     }

     public void setServer(String server){
          this.server = server;
     }
     public String getServer(){
          return server;
     }

     public void setDataBase(String daname){
          this.dbname = daname;
     }
     public String getDataBase(){
          return dbname;
     }

     public Connection getConnection(){
        try{
            Class.forName("com.mysql.jdbc.Driver");
            con = DriverManager.getConnection