连接数据库
用的是Oracle
package twenty;
import java.sql.*;
public class conn {
Connection con;
public Connection getConnection(){
try{
Class.forName("oracle.jdbc.OracleDriver");
}catch (ClassNotFoundException e){
e.printStackTrace();
}
try {
con=DriverManager.getConnection("jdbc:oracle:thin:@//10.12.30.102:1521/mcsdb","mcsadm","mcs123");
}catch(SQLException e){
e.printStackTrace();
}
return con;
}
public static void main(String[] args) {
conn c=new conn();
c.getConnection();
}
}
但是总是报错,应该是驱动不对。
用PLSQL软件,直接用sql语言进行查询 修改 删除等;
select t.createtime,t.* from transportjob t
where to_char(createtime,‘yyyymmddHH24mm’) < ‘201911201215’
order by t.createtime asc