Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8352945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:07:26+00:00 2026-06-09T09:07:26+00:00

I am using Spring JDBC template for jdbc operations. Since I am using BeanPropertySqlParameterSource,

  • 0

I am using Spring JDBC template for jdbc operations.
Since I am using BeanPropertySqlParameterSource, the bean’s START_TIME variables is assigned with java.sql.date type.
in Oracle db, the column is mentioned as “DATE” type (and don’t have TIMESTAMP type, even the db is 10.2 ver)

Now when I set

bean.setStartTime(new Date(System.currentTime()) 

it’s storing with date and time stamp as 00:00:00

Please tell me how can i Store the time stamp also.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T09:07:28+00:00Added an answer on June 9, 2026 at 9:07 am

    You need to use java.sql.Timestamp

     bean.setStartTime(new java.sql.Timestamp(...))
    

    java.sql.Date removes the time part

    From the Javadocs:

    To conform with the definition of SQL DATE, the millisecond values wrapped by a java.sql.Date instance must be ‘normalized’ by setting the hours, minutes, seconds, and milliseconds to zero in the particular time zone with which the instance is associated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing some simple DAOs in Java using JDBC (no Spring, Hibernate or anything
I was using spring jdbc template to insert some data into the database and
I am using Spring Jdbc template and for that I have context.xml <property name=driverClassName
I'm using Spring-JDBC to execute the SQL and fetch the results. SELECT SUM(spend) total_sum
I have the following partial spring context xml file: <bean name=template class=org.springframework.jdbc.core.JdbcTemplate> <property name=dataSource
I am using JDBC (and spring-jdbc's jdbcTemplate) to access my database in a java
I have a Java library where I access the DB via JDBC using Spring's
I have a Java application that talks to a MySQL database using Spring JDBC
I'm using the JDBC template and want to read from a database using prepared
Using Spring 1.2.1 and oracle.jdbc.pool.OracleDataSource 10.2.0.3.0 I sometimes get a stack trace like below.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.