Hi, We are using jconn4.jar and are facing a strange issue around midnight when the timestamp returned in the output parameters is off by an hour. Please let me know in case you have faced a similar issue and have a solution for the same. |
Hi, We are using jconn4.jar and are facing a strange issue around midnight when the timestamp returned in the output parameters is off by an hour. Please let me know in case you have faced a similar issue and have a solution for the same. |
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Question tags:
question asked: 07 Jul '17, 06:41
question was seen: 1,554 times
last updated: 11 Jul '17, 18:41
I'd like to help you, but I do not know:
1. The SA version;
2. The library version;
3. The stored procedure, how to get the timestamp;
4. The table schema and sample data used in the stored procedure above;
5. The SA time zone & localization settings;
6. The application time zone & localization settings;
7. How you compare the values to find a one hour difference.
If you want, you can log the timestamp in the stored procedure using MESSAGE to determine a temporary timestamp value.
You see, at least I have tried.
Hi Vlad,
I am just hitting a stored proc that takes as an input parameter a timsstamp and returns a result set and an output paramter. The result set has the correct time stamp however the output parameter shows timestamp off by an hour.
If the input timestamp is "2017-06-27 00:54:41.913" The output parameter gives : 23:54:41.913 The result set gives : "2017-06-27 00:54:41.913"
I am using a simple public static void main method to test it. Let me know if you need any other info.It works perfectly fine with ojdbc jar.
public static void main(String[] args)throws SQLException { try {
Are the client calling the proc and the database server on the same or on different machines? Are they using different time zones/locales?
What is the definition of your procedure, as you tell of input/output parameters and result sets?
Yes, I'm basically re-asking for the answers to Vlad's questions 3, 5 and 6, and the first two are also left unanswered...
1) The client calling the proc and the database are on different machines. 2)They are using the same locales and time zones (IE) 3)Reading the output param with statement System.out.println(((CallableStatement)stmt).getTimestamp(9));
4) What is SA that you are referring to?How do I get its timezone?
Please find below the remaining code.
private static void executeQuery(Statement stmt) {
try{
SA means SQL Anywhere, the database system this forum is focussed on. Or do you use SAP Sybase ASE?
We would be more interested in the stored procedure's code (as that evaluates the timestamp on the server's side), not the calling Java code...
As to the time zones, the following query displays the time zone adjustment for the database server vs. the client/current connection:
If they are different, the database server and the client application may treat non-UTC timestamp values differently.
Volker , The proc code on the data base side is almost 5 years old.We are able to retrieve the correct time stamp from the output parameters using ojdbc. I don't have the stored proc's code as that is maintained by a third party.
I meant with jtds it works.
So do you use Sybase/SAP ASE or SQL Anywhere?
FWIW, for jConnect there seems to have been a bug fix w.r.t. timestamps and particular "time lags" around midnight, in case that applies to you (which I can't tell), see that older FAQ...
Hm. I have read this thread carefully, and I still doubt that my questions have been answered. We don't even know the server name/version, as well as the library version.
I agree...