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 8407149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:17:33+00:00 2026-06-09T23:17:33+00:00

I have the below SQL query select to_date(start_date, ‘dd-Mon-yy’) AS start_date FROM table I

  • 0

I have the below SQL query

select to_date(start_date, 'dd-Mon-yy') AS start_date FROM table

I also have the below ResultSet objects (rs)

rs.getDate("start_date")

When I run the query in SQL developer directly against the database (Oracle) the format is returned as expected (08-AUG-12), but when I run the query in my Java app using JDBC it prints out as 2012-08-08.

Am I getting the format the correct way? Should I just select on the column (date datatype) and then format via JodaTime’s DateTimeFormatter? I’m not sure what I’m doing wrong here.

The same thing happens when I convert from java.sql.Date to java.util.Date…

  • 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-09T23:17:34+00:00Added an answer on June 9, 2026 at 11:17 pm

    Database format is not taken in consideration when you are dealing with a Date object in Java. If you want to match exactly the format that you have on your function, you can use TO_CHAR, and fetch the column as a String.

    Alternatively, you keep fetching the column as Date, and then format it accordingly with DateTimeFormatter, for example.

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

Sidebar

Related Questions

I have an SQL query (below) that essentially takes a student from tbStudents, and
I have a T-SQL query as below which queries a table holding the search
I have the code below: string SQL = select * from + TableName; using
Consider the SQL query below: SELECT * FROM opening_hours WHERE week_day = WEEKDAY(NOW()) +
I have the below SQL query: SELECT g.name AS gname, COUNT(u.id) AS noMembers, f.name
I have a SQL query which retrieve wall post list $qry=mysql_query(SELECT senderid,post,date FROM .post_table.
I'm using Sql-Server, and I have the below query which returns all columns that
I have a problem with the SQL statement detailed below. The query returns the
i have four tables like below in sql server 2008 : TABLE 1 ->
I have a table similar to below in sql server 2005 date_column | field1

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.