• 大小: 6.82MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-26
  • 语言: Java
  • 标签: Jsp  网上花店  

资源简介

这是一个完整的项目(带源码,数据库脚本),可以在Myeclipse中直接运行。 需要的朋友可以拿去!

资源截图

代码片段和文件信息

package com;

import java.sql.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Collection;

public class AdminBean
{
    private Connection con;
    AdminClass admin=new AdminClass();

    public AdminBean()
    {
        try
        {
            con = DBConnection.getConnection();
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }

    public void setAdminInfo(AdminClass admin) {
        this.admin = admin;
    }
    public void addAdminInfo()throws Exception
    {
        try
        {

              PreparedStatement stm=con.prepareStatement(“insert into admin values(??)“);
              stm.setString(1admin.getAdminName());
              stm.setString(2admin.getAdminPass());

              try
              {
                  stm.executeQuery();
              }
              catch(Exception e)
              {
              }


        }
        catch(Exception e)
        {
                e.printStackTrace();
                throw e;
        }
    }
    public boolean checkAdminInfo()throws Exception
    {
        boolean flag=false;
        try
        {

                PreparedStatement stat=con.prepareStatement(“select * from admin where adminName=? and adminPass=?“);
                stat.setString(1admin.getAdminName());
                stat.setString(2admin.getAdminPass());
                ResultSet result=stat.executeQuery();

                if(result.next())
                {
                    flag=true;
                }

                result.close();
                stat.close();
        }
        catch(Exception e)
        {
                e.printStackTrace();
                throw e;
        }
        return flag;
    }

    public AdminClass getAdminInfo()throws Exception
    {
        AdminClass admin1=new AdminClass();
        try
        {
                PreparedStatement stat=con.prepareStatement(“select * from admin where adminName=? and adminPass=?“);
                stat.setString(1admin.getAdminName());
                stat.setString(2admin.getAdminPass());
                ResultSet result=stat.executeQuery();

                while(result.next())
                {
                      int id=result.getInt(1);
                      String name=result.getString(2);
                      String pass=result.getString(3);

                      //System.out.println(name+“    “+sex);

                      admin1.setAdminId(id);
                      admin1.setAdminName(name);
                      admin1.setAdminPass(pass);
                }
                result.close();
                stat.close();

        }
        catch(Exception e)
        {
                e.printStackTrace();
                throw e;
        }
        return admin1;
    }
    
    public Collection getAllUserInfo()
    {
    AdminClass admin;
    ArrayL

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        340  2007-09-27 11:20  FlowerShop\.classpath

     文件        303  2007-09-27 11:20  FlowerShop\.mymetadata

     文件       1228  2007-09-27 11:51  FlowerShop\.project

     文件      61572  2007-10-13 15:34  FlowerShop\db\sql脚本.sql

     文件       2897  2007-09-27 11:21  FlowerShop\src\com\AdminBean.class

     文件       4069  2007-09-27 11:22  FlowerShop\src\com\AdminBean.java

     文件        758  2007-09-27 11:21  FlowerShop\src\com\AdminClass.class

     文件        657  2007-09-27 11:22  FlowerShop\src\com\AdminClass.java

     文件       5157  2007-09-27 11:21  FlowerShop\src\com\Cart.class

     文件       7838  2007-09-27 11:22  FlowerShop\src\com\Cart.java

     文件        731  2007-09-27 11:21  FlowerShop\src\com\DBConnection.class

     文件        629  2007-09-27 11:22  FlowerShop\src\com\DBConnection.java

     文件       1211  2007-09-27 11:21  FlowerShop\src\com\ding\EncodingFilter.class

     文件       1447  2007-09-27 11:23  FlowerShop\src\com\ding\EncodingFilter.java

     文件      10929  2007-09-27 11:21  FlowerShop\src\com\GoodsBean.class

     文件      27840  2007-09-27 11:22  FlowerShop\src\com\GoodsBean.java

     文件       2031  2007-09-27 11:21  FlowerShop\src\com\GoodsClass.class

     文件       2359  2007-09-27 11:22  FlowerShop\src\com\GoodsClass.java

     文件       6630  2008-01-28 14:38  FlowerShop\src\com\leavelanguageBean.java

     文件       1212  2007-09-27 11:21  FlowerShop\src\com\LeaveLanguageClass.class

     文件       1241  2007-09-27 11:22  FlowerShop\src\com\LeaveLanguageClass.java

     文件       4228  2007-09-27 11:21  FlowerShop\src\com\LeaveLauguageBean.class

     文件        954  2007-09-27 11:21  FlowerShop\src\com\OrdersClass.class

     文件        912  2007-09-27 11:22  FlowerShop\src\com\OrdersClass.java

     文件        951  2007-09-27 11:21  FlowerShop\src\com\OrdersDetailsClass.class

     文件        873  2007-09-27 11:22  FlowerShop\src\com\OrdersDetailsClass.java

     文件        912  2007-09-27 11:21  FlowerShop\src\com\PageNumber.class

     文件        918  2007-09-27 11:22  FlowerShop\src\com\PageNumber.java

     文件       3383  2007-09-27 11:21  FlowerShop\src\com\ProduceBean.class

     文件       5158  2007-09-27 11:22  FlowerShop\src\com\ProduceBean.java

............此处省略1138个文件信息

评论

共有 条评论