JDBC asking timestamps from Sybase offset by an hour?What is the mysterious 'timestamp' datatype in Sybase?AbstractMethodError on resultset.getObjectJava: Date from unix timestampSybase: Composing a WHERE for a timestamp datatypeSybase offset for paginationsybase from ruby: JDBC connection to SybaseJDBC connection for Sybase with authentication queryIn Sybase, Convert sql timestamp to unixtimeAnswers to the mysterious Sybase ASE 'timestamp' datatype questionsHow to use TIMESTAMP option in sybaseSybase: DateTime to char (timestamp)limit and offset not working in sybase 15.7
"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"
Does the damage from the Absorb Elements spell apply to your next attack, or to your first attack on your next turn?
Why must Chinese maps be obfuscated?
I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?
How much of a wave function must reside inside event horizon for it to be consumed by the black hole?
Is Electric Central Heating worth it if using Solar Panels?
Crossed out red box fitting tightly around image
How do I deal with a coworker that keeps asking to make small superficial changes to a report, and it is seriously triggering my anxiety?
My bank got bought out, am I now going to have to start filing tax returns in a different state?
Can a stored procedure reference the database in which it is stored?
Co-worker works way more than he should
A Paper Record is What I Hamper
What makes accurate emulation of old systems a difficult task?
Apply a different color ramp to subset of categorized symbols in QGIS?
Complex numbers z=-3-4i polar form
Restricting the options of a lookup field, based on the value of another lookup field?
Negative Resistance
How do I check if a string is entirely made of the same substring?
What is this word supposed to be?
Find the identical rows in a matrix
Why do games have consumables?
Is there really no use for MD5 anymore?
A strange hotel
Is Diceware more secure than a long passphrase?
JDBC asking timestamps from Sybase offset by an hour?
What is the mysterious 'timestamp' datatype in Sybase?AbstractMethodError on resultset.getObjectJava: Date from unix timestampSybase: Composing a WHERE for a timestamp datatypeSybase offset for paginationsybase from ruby: JDBC connection to SybaseJDBC connection for Sybase with authentication queryIn Sybase, Convert sql timestamp to unixtimeAnswers to the mysterious Sybase ASE 'timestamp' datatype questionsHow to use TIMESTAMP option in sybaseSybase: DateTime to char (timestamp)limit and offset not working in sybase 15.7
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
There is a database procedure (to which I do not have access to, so I can't view its source or edit it) in a Sybase database that I query for information about events, and those events have a start and end date.
EDIT: This effect also happens when I queried a freshly-created table of just dates, created as such:
create table jvo_test.test_dates(dt datetime not null primary key)
insert into jvo_test.test_dates(dt) select dateadd(mi, (id-1) *30, '2019-03-06 00:00:00') from rle.row_generator where id between 1 and 48
END EDIT
The trouble is that when these events take place an hour after midnight (so in the 00:00 - 01:00 range) the resulting timestamp jumps back in past an hour???
Example: right now the procedure returns two events, one on 23:44 and the other for 00:07
Code:
Connection c = ds.getConnection();
String sql = "procedure_name 'param1', 'param2', 'param3'";
PreparedStatement ps = c.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
while (rs.next())
for(int i = 1; i < rsmd.getColumnCount(); i++)
log.debug(" is of type: ", rsmd.getColumnName(i), rsmd.getColumnType(i));
log.debug("AS STRING start_time: , end_time: ",
rs.getString("start_time"),rs.getString("end_time"));
log.debug("AS TIMESTAMP start_time: , end_time: ",
rs.getTimestamp("start_time"),rs.getTimestamp("end_time"));
This results in the following log lines
start_time is of type: 93
end_time is of type: 93
AS STRING start_time: 2019-02-19 23:44:23.000000, end_time: 2019-02-19 23:44:29.000000
AS TIMESTAMP start_time: 2019-02-19 23:44:23.0, end_time: 2019-02-19 23:44:29.0
start_time is of type: 93
end_time is of type: 93
AS STRING start_time: 2019-02-20 00:0-53:46.000000, end_time: 2019-02-20 00:0-53:53.000000
AS TIMESTAMP start_time: 2019-02-19 23:07:46.0, end_time: 2019-02-19 23:07:53.0
start_time and end_time are both of type 93 or Timestamp.
Notice how the second event, which should be starting on 00:07, has jumped an hour into the past to 23:07
Where am I going wrong to have this one-hour offset?
java timestamp sybase
|
show 6 more comments
There is a database procedure (to which I do not have access to, so I can't view its source or edit it) in a Sybase database that I query for information about events, and those events have a start and end date.
EDIT: This effect also happens when I queried a freshly-created table of just dates, created as such:
create table jvo_test.test_dates(dt datetime not null primary key)
insert into jvo_test.test_dates(dt) select dateadd(mi, (id-1) *30, '2019-03-06 00:00:00') from rle.row_generator where id between 1 and 48
END EDIT
The trouble is that when these events take place an hour after midnight (so in the 00:00 - 01:00 range) the resulting timestamp jumps back in past an hour???
Example: right now the procedure returns two events, one on 23:44 and the other for 00:07
Code:
Connection c = ds.getConnection();
String sql = "procedure_name 'param1', 'param2', 'param3'";
PreparedStatement ps = c.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
while (rs.next())
for(int i = 1; i < rsmd.getColumnCount(); i++)
log.debug(" is of type: ", rsmd.getColumnName(i), rsmd.getColumnType(i));
log.debug("AS STRING start_time: , end_time: ",
rs.getString("start_time"),rs.getString("end_time"));
log.debug("AS TIMESTAMP start_time: , end_time: ",
rs.getTimestamp("start_time"),rs.getTimestamp("end_time"));
This results in the following log lines
start_time is of type: 93
end_time is of type: 93
AS STRING start_time: 2019-02-19 23:44:23.000000, end_time: 2019-02-19 23:44:29.000000
AS TIMESTAMP start_time: 2019-02-19 23:44:23.0, end_time: 2019-02-19 23:44:29.0
start_time is of type: 93
end_time is of type: 93
AS STRING start_time: 2019-02-20 00:0-53:46.000000, end_time: 2019-02-20 00:0-53:53.000000
AS TIMESTAMP start_time: 2019-02-19 23:07:46.0, end_time: 2019-02-19 23:07:53.0
start_time and end_time are both of type 93 or Timestamp.
Notice how the second event, which should be starting on 00:07, has jumped an hour into the past to 23:07
Where am I going wrong to have this one-hour offset?
java timestamp sybase
1
Why does it say "-53:46" and isn't midnight - 53 = 07?
– Joakim Danielson
Mar 8 at 12:50
That is a splendid question Joakim and one I wouldn't mind finding out myself either
– Karbik
Mar 8 at 12:56
1
Reading this question and specially the approved answer I am pretty sure you can't users.getTimestamp()
– Joakim Danielson
Mar 8 at 13:28
1
Or maybe your jdbc driver is actually supporting this type but the issue has to do with Locale and/or time zone settings?
– Joakim Danielson
Mar 8 at 13:35
1
Sorry. It would seem that your JDBC driver is too old for what I was suggesting (source). In case you want to upgrade, this might be relevant. PassingInstant.classorLocalDateTime.classtogetObjectrequires JDBC 4.2.
– Ole V.V.
Mar 10 at 17:52
|
show 6 more comments
There is a database procedure (to which I do not have access to, so I can't view its source or edit it) in a Sybase database that I query for information about events, and those events have a start and end date.
EDIT: This effect also happens when I queried a freshly-created table of just dates, created as such:
create table jvo_test.test_dates(dt datetime not null primary key)
insert into jvo_test.test_dates(dt) select dateadd(mi, (id-1) *30, '2019-03-06 00:00:00') from rle.row_generator where id between 1 and 48
END EDIT
The trouble is that when these events take place an hour after midnight (so in the 00:00 - 01:00 range) the resulting timestamp jumps back in past an hour???
Example: right now the procedure returns two events, one on 23:44 and the other for 00:07
Code:
Connection c = ds.getConnection();
String sql = "procedure_name 'param1', 'param2', 'param3'";
PreparedStatement ps = c.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
while (rs.next())
for(int i = 1; i < rsmd.getColumnCount(); i++)
log.debug(" is of type: ", rsmd.getColumnName(i), rsmd.getColumnType(i));
log.debug("AS STRING start_time: , end_time: ",
rs.getString("start_time"),rs.getString("end_time"));
log.debug("AS TIMESTAMP start_time: , end_time: ",
rs.getTimestamp("start_time"),rs.getTimestamp("end_time"));
This results in the following log lines
start_time is of type: 93
end_time is of type: 93
AS STRING start_time: 2019-02-19 23:44:23.000000, end_time: 2019-02-19 23:44:29.000000
AS TIMESTAMP start_time: 2019-02-19 23:44:23.0, end_time: 2019-02-19 23:44:29.0
start_time is of type: 93
end_time is of type: 93
AS STRING start_time: 2019-02-20 00:0-53:46.000000, end_time: 2019-02-20 00:0-53:53.000000
AS TIMESTAMP start_time: 2019-02-19 23:07:46.0, end_time: 2019-02-19 23:07:53.0
start_time and end_time are both of type 93 or Timestamp.
Notice how the second event, which should be starting on 00:07, has jumped an hour into the past to 23:07
Where am I going wrong to have this one-hour offset?
java timestamp sybase
There is a database procedure (to which I do not have access to, so I can't view its source or edit it) in a Sybase database that I query for information about events, and those events have a start and end date.
EDIT: This effect also happens when I queried a freshly-created table of just dates, created as such:
create table jvo_test.test_dates(dt datetime not null primary key)
insert into jvo_test.test_dates(dt) select dateadd(mi, (id-1) *30, '2019-03-06 00:00:00') from rle.row_generator where id between 1 and 48
END EDIT
The trouble is that when these events take place an hour after midnight (so in the 00:00 - 01:00 range) the resulting timestamp jumps back in past an hour???
Example: right now the procedure returns two events, one on 23:44 and the other for 00:07
Code:
Connection c = ds.getConnection();
String sql = "procedure_name 'param1', 'param2', 'param3'";
PreparedStatement ps = c.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
while (rs.next())
for(int i = 1; i < rsmd.getColumnCount(); i++)
log.debug(" is of type: ", rsmd.getColumnName(i), rsmd.getColumnType(i));
log.debug("AS STRING start_time: , end_time: ",
rs.getString("start_time"),rs.getString("end_time"));
log.debug("AS TIMESTAMP start_time: , end_time: ",
rs.getTimestamp("start_time"),rs.getTimestamp("end_time"));
This results in the following log lines
start_time is of type: 93
end_time is of type: 93
AS STRING start_time: 2019-02-19 23:44:23.000000, end_time: 2019-02-19 23:44:29.000000
AS TIMESTAMP start_time: 2019-02-19 23:44:23.0, end_time: 2019-02-19 23:44:29.0
start_time is of type: 93
end_time is of type: 93
AS STRING start_time: 2019-02-20 00:0-53:46.000000, end_time: 2019-02-20 00:0-53:53.000000
AS TIMESTAMP start_time: 2019-02-19 23:07:46.0, end_time: 2019-02-19 23:07:53.0
start_time and end_time are both of type 93 or Timestamp.
Notice how the second event, which should be starting on 00:07, has jumped an hour into the past to 23:07
Where am I going wrong to have this one-hour offset?
java timestamp sybase
java timestamp sybase
edited Mar 13 at 14:21
Karbik
asked Mar 8 at 12:44
KarbikKarbik
265
265
1
Why does it say "-53:46" and isn't midnight - 53 = 07?
– Joakim Danielson
Mar 8 at 12:50
That is a splendid question Joakim and one I wouldn't mind finding out myself either
– Karbik
Mar 8 at 12:56
1
Reading this question and specially the approved answer I am pretty sure you can't users.getTimestamp()
– Joakim Danielson
Mar 8 at 13:28
1
Or maybe your jdbc driver is actually supporting this type but the issue has to do with Locale and/or time zone settings?
– Joakim Danielson
Mar 8 at 13:35
1
Sorry. It would seem that your JDBC driver is too old for what I was suggesting (source). In case you want to upgrade, this might be relevant. PassingInstant.classorLocalDateTime.classtogetObjectrequires JDBC 4.2.
– Ole V.V.
Mar 10 at 17:52
|
show 6 more comments
1
Why does it say "-53:46" and isn't midnight - 53 = 07?
– Joakim Danielson
Mar 8 at 12:50
That is a splendid question Joakim and one I wouldn't mind finding out myself either
– Karbik
Mar 8 at 12:56
1
Reading this question and specially the approved answer I am pretty sure you can't users.getTimestamp()
– Joakim Danielson
Mar 8 at 13:28
1
Or maybe your jdbc driver is actually supporting this type but the issue has to do with Locale and/or time zone settings?
– Joakim Danielson
Mar 8 at 13:35
1
Sorry. It would seem that your JDBC driver is too old for what I was suggesting (source). In case you want to upgrade, this might be relevant. PassingInstant.classorLocalDateTime.classtogetObjectrequires JDBC 4.2.
– Ole V.V.
Mar 10 at 17:52
1
1
Why does it say "-53:46" and isn't midnight - 53 = 07?
– Joakim Danielson
Mar 8 at 12:50
Why does it say "-53:46" and isn't midnight - 53 = 07?
– Joakim Danielson
Mar 8 at 12:50
That is a splendid question Joakim and one I wouldn't mind finding out myself either
– Karbik
Mar 8 at 12:56
That is a splendid question Joakim and one I wouldn't mind finding out myself either
– Karbik
Mar 8 at 12:56
1
1
Reading this question and specially the approved answer I am pretty sure you can't use
rs.getTimestamp()– Joakim Danielson
Mar 8 at 13:28
Reading this question and specially the approved answer I am pretty sure you can't use
rs.getTimestamp()– Joakim Danielson
Mar 8 at 13:28
1
1
Or maybe your jdbc driver is actually supporting this type but the issue has to do with Locale and/or time zone settings?
– Joakim Danielson
Mar 8 at 13:35
Or maybe your jdbc driver is actually supporting this type but the issue has to do with Locale and/or time zone settings?
– Joakim Danielson
Mar 8 at 13:35
1
1
Sorry. It would seem that your JDBC driver is too old for what I was suggesting (source). In case you want to upgrade, this might be relevant. Passing
Instant.class or LocalDateTime.class to getObject requires JDBC 4.2.– Ole V.V.
Mar 10 at 17:52
Sorry. It would seem that your JDBC driver is too old for what I was suggesting (source). In case you want to upgrade, this might be relevant. Passing
Instant.class or LocalDateTime.class to getObject requires JDBC 4.2.– Ole V.V.
Mar 10 at 17:52
|
show 6 more comments
1 Answer
1
active
oldest
votes
Problem was resolved by updating the JDBC database driver from build 26502 to 27361
To find out the version of your driver, do
java -jar jconn4.jar
Old version output this as the first row:
jConnect (TM) for JDBC(TM)/7.00(Build 26502)/P/EBF17993/JDK16/Thu Jun 3 3:09:09 2010
New version output this:
jConnect (TM) for JDBC(TM)/7.07 SP139 (Build 27361)/P/EBF27161/JDK 1.6.0/jdbcmain/OPT/Thu Jul 27 02:39:00 PDT 2017
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55063509%2fjdbc-asking-timestamps-from-sybase-offset-by-an-hour%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Problem was resolved by updating the JDBC database driver from build 26502 to 27361
To find out the version of your driver, do
java -jar jconn4.jar
Old version output this as the first row:
jConnect (TM) for JDBC(TM)/7.00(Build 26502)/P/EBF17993/JDK16/Thu Jun 3 3:09:09 2010
New version output this:
jConnect (TM) for JDBC(TM)/7.07 SP139 (Build 27361)/P/EBF27161/JDK 1.6.0/jdbcmain/OPT/Thu Jul 27 02:39:00 PDT 2017
add a comment |
Problem was resolved by updating the JDBC database driver from build 26502 to 27361
To find out the version of your driver, do
java -jar jconn4.jar
Old version output this as the first row:
jConnect (TM) for JDBC(TM)/7.00(Build 26502)/P/EBF17993/JDK16/Thu Jun 3 3:09:09 2010
New version output this:
jConnect (TM) for JDBC(TM)/7.07 SP139 (Build 27361)/P/EBF27161/JDK 1.6.0/jdbcmain/OPT/Thu Jul 27 02:39:00 PDT 2017
add a comment |
Problem was resolved by updating the JDBC database driver from build 26502 to 27361
To find out the version of your driver, do
java -jar jconn4.jar
Old version output this as the first row:
jConnect (TM) for JDBC(TM)/7.00(Build 26502)/P/EBF17993/JDK16/Thu Jun 3 3:09:09 2010
New version output this:
jConnect (TM) for JDBC(TM)/7.07 SP139 (Build 27361)/P/EBF27161/JDK 1.6.0/jdbcmain/OPT/Thu Jul 27 02:39:00 PDT 2017
Problem was resolved by updating the JDBC database driver from build 26502 to 27361
To find out the version of your driver, do
java -jar jconn4.jar
Old version output this as the first row:
jConnect (TM) for JDBC(TM)/7.00(Build 26502)/P/EBF17993/JDK16/Thu Jun 3 3:09:09 2010
New version output this:
jConnect (TM) for JDBC(TM)/7.07 SP139 (Build 27361)/P/EBF27161/JDK 1.6.0/jdbcmain/OPT/Thu Jul 27 02:39:00 PDT 2017
answered Mar 19 at 10:33
KarbikKarbik
265
265
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55063509%2fjdbc-asking-timestamps-from-sybase-offset-by-an-hour%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Why does it say "-53:46" and isn't midnight - 53 = 07?
– Joakim Danielson
Mar 8 at 12:50
That is a splendid question Joakim and one I wouldn't mind finding out myself either
– Karbik
Mar 8 at 12:56
1
Reading this question and specially the approved answer I am pretty sure you can't use
rs.getTimestamp()– Joakim Danielson
Mar 8 at 13:28
1
Or maybe your jdbc driver is actually supporting this type but the issue has to do with Locale and/or time zone settings?
– Joakim Danielson
Mar 8 at 13:35
1
Sorry. It would seem that your JDBC driver is too old for what I was suggesting (source). In case you want to upgrade, this might be relevant. Passing
Instant.classorLocalDateTime.classtogetObjectrequires JDBC 4.2.– Ole V.V.
Mar 10 at 17:52