java select 语句怎么写

2024-12-16 06:13:20
推荐回答(1个)
回答1:

// statement用来执行SQL语句
Statement statement = conn.createStatement();
String sql = "select ** from ** where **";
ResultSet rs = statement.executeQuery(sql);
//假设数据库表只有两个属性值,一个属性值为String类型,另一个为Int类型