省略号的意思是你去查和它相同的函数,就可以了。没有参数。最后一个省略号的
意思是后面与这个问题无关了。重新给你一些代码吧。这是我写来连接POSTGRE的。给你了。
Connection con;
Statement stmt;
ResultSet rs;
String url ="jdbc
ostgresql://192.168.0.69/wange" ;
String databaseUser ="pediatrician";
String driver ="postgresql.Driver";
String password ="clinic";
java.sql.Time enter=new java.sql.Time(System.currentTimeMillis ());
java.sql.Date ent=new java.sql.Date(System.currentTimeMillis ());
try {
Class.forName(driver);
con=DriverManager.getConnection(url,databaseUser,password);
stmt = con.createStatement();
}
catch (Exception driverE) {
return;
}
try {
String id;
rs = stmt.executeQuery("select max(id)+1 from drlogintime");
if(!rs.next())
return;
id= rs.getString(1);
if(id==null) id=""+1;
stmt.execute("insert into drlogintime(id,drid,ontime,date) values("+id+","+drid+","+System.currentTimeMillis ()+",'"+ent+" "+ enter+"')");
rs = stmt.executeQuery("select id from room where drid="+flag+drid);
if(rs.next()){
stmt.execute("update room set head='"+head+"' where drid="+id);
}
else
{
rs = stmt.executeQuery("select max(id)+1 from room");
rs.next();
String roomid = rs.getString(1);
if(roomid == null) roomid = ""+1;
stmt.execute("insert into room values("+roomid+",'"+flag+drid+"',0,0,0,0,0,'"+head+"')");
}
con.close();
}
catch (Exception queryE) {
return;
}