我编写了以下两个类:设备.javaclass Equipment{ private int id; private String name; private String local; public void setId(int id){ this.id = id; } public void setName(String n){ this.name = n; } public void setLocal(String l){ this.local = l; } public int getId(){ return this.id; } public String getName(){ return this.name; } public String getLocal(){ return this.local; }}我用这门课进行了测试,效果很好import java.util.*;import java.sql.*;class MainTest{ public static void main(String[] args) throws SQLException { JDBCCommands jdbc = new JDBCCommands(); //jdbc.Create("Teste novo", "Novo Teste"); for(Equipment c : jdbc.Show()){ System.out.print(c.getId() + " "); System.out.print(c.getName() + " "); System.out.print(c.getLocal() + "\n"); } System.out.println("-------------------------------------"); for(Equipment c : jdbc.Search("est n" , "est")){ System.out.print(c.getId() + " "); System.out.print(c.getName() + " "); System.out.print(c.getLocal() + "\n"); } }}
添加回答
举报
0/150
提交
取消