📄 test.java
字号:
package com.eshop.database;
import java.sql.ResultSet;
import java.sql.SQLException;
import com.eshop.database.dbconn;
import com.eshop.dto.Goods;
public class test {
/**
* @param args
* @throws SQLException
*/
public static void main(String[] args) throws SQLException {
dbconn conn = new dbconn();
ResultSet rs = null;
rs = conn.executeQuery("select * from goods");
while(rs.next()){
Goods goods = new Goods();
goods.setId(rs.getInt("id"));
goods.setBrand(rs.getString("brand"));
goods.setIntime(rs.getString("intime"));
goods.setIntroduc(rs.getString("introduce"));
goods.setNowprice(rs.getDouble("nowprice"));
goods.setPicture(rs.getString("picture"));
goods.setPrice(rs.getDouble("price"));
goods.setType("type");
goods.setSaletol(rs.getInt("saletol"));
System.out.print(goods.getId());
}
conn.close();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -