Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void insertarValores() throws SQLException{
- PreparedStatement ps = null;
- conectar con = new conectar();
- Connection conn = null;
- conn = con. conectar();
- try{
- java.sql.Date sqlDate = java.sql.Date.valueOf(ldt.toLocalDate());
- ps = conn.prepareStatement(SQL_INSERT);
- ps.setString(1, user_dto.getId_usuario());
- ps.setString(2, instdDto.getId_instituto());
- ps.setString(3, dto.getT1_A_A());
- .
- .
- .
- ps.setTimestamp(39, getCurrentTimeStamp());
- ps.executeUpdate();
- }catch(SQLException e){
- System.err.println(""+e);
- }finally{
- cerrar(ps);
- cerrar(conn);
- }
- }
- private static java.sql.Timestamp getCurrentTimeStamp() {
- java.util.Date today = new java.util.Date();
- return new java.sql.Timestamp(today.getTime());
- }
- com.microsoft.sqlserver.jdbc.SQLServerException: No se puede insertar un valor explícito en una columna de marca de tiempo. Utilice INSERT con una lista de columnas para excluir la columna de marca de tiempo o inserte DEFAULT en la columna de marca de tiempo.
Add Comment
Please, Sign In to add comment