Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...One of the best run forums I have used in years! ...I like the way the site is organized and your no tolerance of flames..."

Geography

Where in the world do Tek-Tips members come from?

Difference between ResultSet and queryDataSet

pakfak (TechnicalUser)
13 Jun 06 17:16
Hi to all.
I have a strange problem I have spend many days to search about it but nothing.
1. I use Jbuilder 2005 Enterprise
2. Oracle 10
I try to do something very simple: just to export a simple query to a Jtable.
The QUERY: (select dt from date_table )
In Oracle the datatype for dt is DATE but if you execute the query in database you will receive type like: (dd/MM/yyyy HH:mi:ss)
But in jbuilder:
1. IF I use a). database1.setConnection(new ConnectionDescriptor(...) ) ---to connect to oracle
b). queryDataSet1.setQuery( select ...) ---to insert the query
c). jdbTable1.setDataSet(queryDataSet1); ---To export my query's results to Jtable
d). column1.setDataType(com.borland.dx.dataset.Variant.TIMESTAMP) ---to declare somehow the column's datatype to timestamp
The results are (dd/MM/yyyy HH:mi:ss) but on every record the time is 12:00:00 am

2. IF I use a). Connection db_connection = DriverManager.getConnection(...) ---to connect to oracle
b). ResultSet result = db_statement.executeQuery(select ...) ---to insert the query
c). System.out.println ("DT: " + result.getTimestamp("DT")) --- To export my query's results using data type Timestamp
The results are corect in type (dd/MM/yyyy HH:mi:ss) without problem in time .


The question:
A. can someone explain to me what is the different thats gives me wrong date time?
B. can someone give me an advice how i can take the right results in format: dd/MM/yyyy HH:mi:ss without problem on TIME??
C. if i use the First way (1.) not in oracle but in access with column dt to be date/time everything is ok.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close