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.
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.