Guest User

Untitled

a guest
Sep 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. public void insertarValores() throws SQLException{
  2. PreparedStatement ps = null;
  3. conectar con = new conectar();
  4. Connection conn = null;
  5. conn = con. conectar();
  6. try{
  7. java.sql.Date sqlDate = java.sql.Date.valueOf(ldt.toLocalDate());
  8. ps = conn.prepareStatement(SQL_INSERT);
  9. ps.setString(1, user_dto.getId_usuario());
  10. ps.setString(2, instdDto.getId_instituto());
  11. ps.setString(3, dto.getT1_A_A());
  12. .
  13. .
  14. .
  15. ps.setTimestamp(39, getCurrentTimeStamp());
  16. ps.executeUpdate();
  17. }catch(SQLException e){
  18. System.err.println(""+e);
  19. }finally{
  20. cerrar(ps);
  21. cerrar(conn);
  22.  
  23. }
  24. }
  25.  
  26.  
  27. private static java.sql.Timestamp getCurrentTimeStamp() {
  28.  
  29. java.util.Date today = new java.util.Date();
  30. return new java.sql.Timestamp(today.getTime());
  31.  
  32. }
  33.  
  34. 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