java怎么向Oracle数据库插入时间戳
2016-05-24 · 做真实的自己 用良心做教育
千锋教育
千锋教育专注HTML5大前端、JavaEE、Python、人工智能、UI&UE、云计算、全栈软件测试、大数据、物联网+嵌入式、Unity游戏开发、网络安全、互联网营销、Go语言等培训教育。
向TA提问
关注
展开全部
请参考
public static void insertDemo(String[] args) throws Exception {
MsgSwapDAOImpl dao = new MsgSwapDAOImpl();
Connection conn = dao.jdbcUtil.getConnection();
String appKey ="40825Td288461463";
String msg = "wlllllll";
conn.setAutoCommit(false);
String sql = "insert into TTT(ID, CREATE_DATE) values(?,?)";
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setInt(1, 888888);
pstmt.setTimestamp(2, TimeUtil.nowTimestamp());
pstmt.executeUpdate();
conn.commit();
conn.close();
}
public static void insertDemo(String[] args) throws Exception {
MsgSwapDAOImpl dao = new MsgSwapDAOImpl();
Connection conn = dao.jdbcUtil.getConnection();
String appKey ="40825Td288461463";
String msg = "wlllllll";
conn.setAutoCommit(false);
String sql = "insert into TTT(ID, CREATE_DATE) values(?,?)";
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setInt(1, 888888);
pstmt.setTimestamp(2, TimeUtil.nowTimestamp());
pstmt.executeUpdate();
conn.commit();
conn.close();
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
请参考
public static void insertDemo(String[] args) throws Exception {
MsgSwapDAOImpl dao = new MsgSwapDAOImpl();
Connection conn = dao.jdbcUtil.getConnection();
String appKey ="40825Td288461463";
String msg = "wlllllll";
conn.setAutoCommit(false);
String sql = "insert into TTT(ID, CREATE_DATE) values(?,?)";
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setInt(1, 888888);
pstmt.setTimestamp(2, TimeUtil.nowTimestamp());
pstmt.executeUpdate();
conn.commit();
conn.close();
}
public static void insertDemo(String[] args) throws Exception {
MsgSwapDAOImpl dao = new MsgSwapDAOImpl();
Connection conn = dao.jdbcUtil.getConnection();
String appKey ="40825Td288461463";
String msg = "wlllllll";
conn.setAutoCommit(false);
String sql = "insert into TTT(ID, CREATE_DATE) values(?,?)";
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setInt(1, 888888);
pstmt.setTimestamp(2, TimeUtil.nowTimestamp());
pstmt.executeUpdate();
conn.commit();
conn.close();
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询