Results 1 to 2 of 2

Thread: spring-jdbc SqlServer getdate help

  1. #1

    Question spring-jdbc SqlServer getdate help

    Hi! i need some help...
    I want to execute a update, update a DATETIME registry with the GETDATE() sql server function, but i don't know how to do.
    I've this:
    Code:
    this.simpleJdbcTemplate.update("update [dbo].[PersonaNatural] set FCExpiracion = ? where IDPersona = ? ","getdate()" , personaRut.getIdPersona());
    I try with this too:
    Code:
    this.procGetDate = new SimpleJdbcCall(jdbcTemplate).withFunctionName("getdate");
    this.simpleJdbcTemplate.update("update [dbo].[PersonaNatural] set FCExpiracion = ? where IDPersona = ? ", procGetDate.execute(), personaRut.getIdPersona());

  2. #2
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,806

    Default

    Why ?

    Code:
    this.simpleJdbcTemplate.update("update [dbo].[PersonaNatural] 
    set FCExpiracion = ? where IDPersona = ? ","getdate()" , personaRut.getIdPersona());
    Should be instead personaRut.getdate() ?

    The most important, post here the complete error stack trace
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •