📄 floweritembean.java
字号:
package Flower.model;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.PreparedStatement;
import java.util.Collection;
import java.util.Vector;
import java.util.*;
public class FlowerItemBean
{
Connection con=null;
PreparedStatement pstmt=null;
PreparedStatement pstmt1=null;
ResultSet rs=null;
ResultSet rs1=null;
public Collection FindFlowerItem() throws Exception
{
Vector v=new Vector();
try
{
con=DBConnect.getConnection();
pstmt1=con.prepareStatement("select tejia.teid,tejia.goodsid,flowerinfo.flowername,flowerinfo.flowertypeid,flowerinfo.flowerphoto,goodsinfo.retailprice from flowerinfo,tejia,goodsinfo where tejia.goodsid=goodsinfo.goodsid and goodsinfo.flowerid=flowerinfo.flowerid");
rs1=pstmt1.executeQuery();
while(rs1.next())
{
FlowerItem fi=new FlowerItem();
fi.setteid(rs1.getString(1));
fi.setGoodsid(rs1.getString(2));
fi.setFlowerName(rs1.getString(3));
fi.setFlowerTypeID(rs1.getString(4));
fi.setFlowerPhoto(rs1.getString(5));
fi.setRetailPrice(rs1.getDouble(6));
v.add(fi);
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
return v;
}
public Collection FindFlowerItemjingpin() throws Exception
{
Vector v=new Vector();
try
{
con=DBConnect.getConnection();
pstmt1=con.prepareStatement("select jingpin.jpid,jingpin.goodsid,flowerinfo.flowername,flowerinfo.flowertypeid,flowerinfo.flowerphoto,goodsinfo.retailprice from flowerinfo,jingpin,goodsinfo where jingpin.goodsid=goodsinfo.goodsid and goodsinfo.flowerid=flowerinfo.flowerid");
rs1=pstmt1.executeQuery();
while(rs1.next())
{
FlowerItem fi=new FlowerItem();
fi.setjpid(rs1.getString(1));
fi.setGoodsid(rs1.getString(2));
fi.setFlowerName(rs1.getString(3));
fi.setFlowerTypeID(rs1.getString(4));
fi.setFlowerPhoto(rs1.getString(5));
fi.setRetailPrice(rs1.getDouble(6));
v.add(fi);
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
return v;
}
public Collection FindFlowerItemnew() throws Exception
{
Vector v=new Vector();
try
{
con=DBConnect.getConnection();
pstmt1=con.prepareStatement("select newgoods.ngid,newgoods.goodsid,flowerinfo.flowername,flowerinfo.flowertypeid,flowerinfo.flowerphoto,goodsinfo.retailprice from flowerinfo,newgoods,goodsinfo where newgoods.goodsid=goodsinfo.goodsid and goodsinfo.flowerid=flowerinfo.flowerid");
rs1=pstmt1.executeQuery();
while(rs1.next())
{
FlowerItem fi=new FlowerItem();
fi.setngid(rs1.getString(1));
fi.setGoodsid(rs1.getString(2));
fi.setFlowerName(rs1.getString(3));
fi.setFlowerTypeID(rs1.getString(4));
fi.setFlowerPhoto(rs1.getString(5));
fi.setRetailPrice(rs1.getDouble(6));
v.add(fi);
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
return v;
}
public Collection FindFlowerItemall() throws Exception
{
Vector v=new Vector();
try
{
con=DBConnect.getConnection();
pstmt1=con.prepareStatement("select goodsinfo.goodsid,flowerinfo.flowername,flowerinfo.flowertypeid,flowerinfo.flowerphoto,goodsinfo.retailprice from flowerinfo,goodsinfo where goodsinfo.flowerid=flowerinfo.flowerid");
rs1=pstmt1.executeQuery();
while(rs1.next())
{
FlowerItem fi=new FlowerItem();
fi.setGoodsid(rs1.getString(1));
fi.setFlowerName(rs1.getString(2));
fi.setFlowerTypeID(rs1.getString(3));
fi.setFlowerPhoto(rs1.getString(4));
fi.setRetailPrice(rs1.getDouble(5));
v.add(fi);
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
return v;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -