1、数据库设计,在数据库中插入表,String Provider = “CREATE TABLE Provider ( “+ “number BINARY(31), “ + “Name CHAR(25),“+ “Street CHAR(25),“+“City CHAR(10),“+“State CHAR(14),“+ “Zip CHAR(10),“+“Email CHAR(10),“+“Status CHAR(1),“+ “)“;boolean execute_Provider = stmt.execute(Provider); Provider ( number BINARY(31), Name
2、 CHAR(25),Street CHAR(25),City CHAR(10),State CHAR(14),Zip CHAR(10),Email CHAR(10),Status CHAR(1),),删除数据,String deleteSQL = “DELETE FROM “ + Member + “ where “ + rsmd.getColumnLabel(2) + “!=“;/控制 使member表的第一列 不为的数据删除int affects;affects = stmt.executeUpdate(deleteSQL);rs = stmt.executeQuery(querySQL)
3、;,读取数据,while (rs.next() Dataj = “;for (int i = 1; i = count; i+) if (i = count) Dataj = Dataj + rs.getString(i);break;Dataj = Dataj + rs.getString(i) + “#“;/System.out.println(“steve: “+Dataj);System.out.println(“steve: “ + Dataj);j+; Return Data;,插入数据元素,INSERT INTO ServiceRecord(ServiceRecord.submi
4、ssionDate,ServiceRecord.serviceCode,ServiceRecord.providerNumber,ServiceRecord.memberNumber,ServiceRecord.serviceDate) VALUES ( 09-06-2015 12:00:00, steve,34.9,34,09-06-2015),for (int i = 1; i = count; i+) /构造插入字符串titlei - 1 = rsmd.getColumnLabel(i);/把列属性存储到title数组,第一列的属性对应的是title的第0个元素if (i = count) attribute = attribute + Member + “.“ + titlei - 1 + “)“;/最后一个属性,故需要加括号break;attribute = attribute + Member + “.“ + titlei - 1 + “,“;/之前的都加“,“/ System.out.print(title + “ t“);,