oracle 建表时间戳类型,Oracle插入timestamp类型数据详解

表结构:

create table TEST(

ID INTEGER,

BIRTHDAY TIMESTAMP

);

使用JDBC将日期插入到TIMESTAMP类型字段

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.SQLException;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Test {

static {

try {

Class.forName("oracle.jdbc.driver.OracleDriver");

} catch (ClassNotFoundException e) {

e.printStackTrace();

}

}

/**

* 获得Connection

*

* @return

*/

public static Connection getConnection() {

Connection conn = null;

try {

conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/orcl", "root", "root"

你可能感兴趣的:(oracle,建表时间戳类型)