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

  • SEARCH
  • Home
  • 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 8512329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:14:59+00:00 2026-06-11T04:14:59+00:00

I have a Timestamp object- java.sql.Timestamp time = null; and I have a datetime

  • 0

I have a Timestamp object-

java.sql.Timestamp time = null;

and I have a datetime value val_time in a DB table.

val_time datetime

The situation is, while performaing an operation, this val_time is not getting updated (which is pretty normal in my case). While reading from DB, naturally the datetime value will be null. So the timestamp object will also be null. My question is – can we get some default value other than null?

  • 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-11T04:15:01+00:00Added an answer on June 11, 2026 at 4:15 am

    since you stated in the tags you use mysql, I would recommend you using IFNULL statement in your query to get a default value instead of NULL then.

    SELECT IFNULL(colname, your-default-value) FROM xyz;
    

    http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html#function_ifnull

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

Sidebar

Related Questions

I need a java.sql.Timestamp value corresponding to one hour ago. I have a few
In my Postgresql database, I have a timestamp without time zone with this value
I have a Java Date object containing date and time information. I want to
I have a java.util.Date object, and I need to insert it into a datetime
I have a certain time in milliseconds (in a Timestamp object) and I want
I have a table with a column that is a DATETIME in a SQL
I have a table where each row needs a timestamp marking the time it
My database table have a Timestamp column named as inTime and i am using
Situation : I have a persistable class with variable of java.util.Date type: import java.util.Date;
I have a timestamp object and need to get the milliseconds from it, can

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.