Oracle 12c ojdbc7 driver causing issues with result.getString("DATE_COLUMN") -


we in process of upgrading oracle 12c , using ojdbc7(12.1.0.2.0) driver. noticed while fetching date column table using resultset.getstring("date_column"), returning daylight saving adjusted time well. please note db located in cst timezone.

say e.g.

if date in column inserted "2014-03-09 02:30:00" way day when daylight saving started in in 2014.

here line of code used fetch value.

  string sql = "select date_column a_table";      resultset rs = psmt.executequery(sql);      while (rs.next())      {         string datestring = rs.getstring("date_column");      } 

here results of code snippet 2 different drivers.

odjbc6(11.2.0.3.0) - 2014-03-09 02:30:00

ojdbc7(12.1.0.2.0) - 2014-03-09 03:30:00.0

if see highlighted time fields, can see fetching 3:30:00.0 instead of 2:30 ojdbc7 driver, suggests driver getting daylight savings adjusted time of local timezone of database server, in our case cst, us.

i part appending fractional seconds mentioned in link resultset.getstring(date) differs based on driver

the problem don't need daylight saving adjusted time, need time inserted. however, using other ways of fetching date such resultset.getdate(), resultset.gettimestamp() returning dst adjusted time.

we found way out change type of date column timestamp , problem resolved.

has encountered problem oracle 12c(ojdbc7) driver?

if yes, there better way of resolving it? want avoid changing data type of existing columns timestamp.

having same issue. using rs.getstring(index) avoid daylight saving adjustment date type, ojdbc7, rs.getstring(index) adjusting time daylight saving.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -