我已经连接到我的数据库:
Connection con = DriverManager.getConnection(
"jdbc:mysql://instance23389.db.xeround.com:15296/Inventory","user","password");
PreparedStatement Statement = con.prepareStatement("Select * from inventory");
ResultSet result = Statement.executeQuery();
while(result.next()) {
//What to put here?
}
这是我想要存储在该数据库中的arraylist:
static ArrayList Chart=new ArrayList();
并且这些对象存储在arraylist中:
double Total;
String name;
double quantity;
String unit;
double ProductPrice;
我需要使用什么通用代码来将arraylist存储在MySQL数据库中?
我需要使用什么通用代码才能将arraylist从MySQL数据库中删除?