This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 107262 - Oracle: it's impossible to update/insert value of datatype DATE in DB table
Summary: Oracle: it's impossible to update/insert value of datatype DATE in DB table
Status: RESOLVED WONTFIX
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 6.x
Hardware: PC All
: P3 blocker (vote)
Assignee: John Baker
URL:
Keywords: RELNOTE
Depends on:
Blocks:
 
Reported: 2007-06-19 16:13 UTC by _ alexpetrov
Modified: 2007-11-06 07:19 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Project_screenshots (159.62 KB, application/octet-stream)
2007-06-19 16:15 UTC, _ alexpetrov
Details
Query Editor (233.87 KB, image/png)
2007-07-16 23:20 UTC, _ jimdavidson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ alexpetrov 2007-06-19 16:13:11 UTC
Product Version: NetBeans IDE Dev (Build 200706180000) 
Java: 1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b06 
System: Windows XP version 5.1 running on x86; Cp1251; ru_RU (nb)

The attached .zip-file contains:
- NB 6.0 VWP project "InsUpdDel_Oracle", created according to the tutorial "Performing Inserts, Updates, and Deletes" 
(http://www.netbeans.org/kb/55/vwp-inserts_updates_deletes.html)
- SQL script, which describes tables of DB scheme "Travel"
- screenshots


1. In the window "Runtime" create new database connection for "Oracle 10g" under the tree node "Databases".
1.1 download jdbs drivers (ojdbc14.jar) for Oracle Database 10g Release 2 from
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
1.2 create new jdbc-driver with name "Oracle" under the tree node "Databases | Drivers" (use the downloaded ojdbc14.jar)
1.3 create new connection under the tree node "Databases":
- select "Oracle" in the dropdown list "Name"
- put "jdbc:oracle:thin:@jbrave-pc1.sfbay.sun.com:1521:ora10g" into the "Database URL"
- use "travel" for "User Name" and "Password"

2. Open the attached VWP project and run it 
(sqlDateConverter1 with pattern "dd.MM.yyyy" is used for a table column "textField1", related to the DB Table field
"TRIP.DEPDATE").

3. In web-browser select any person from a Drop Down List and click the button "Save Changes".

Result:
- error message will appear in the web-browser (see "scrnshot_Web_Page_View_SQlDateConverter.JPG")

4. Delete sqlDateConverter1 from property "converter" of a table column "textField1". Run project.
   In web-browser select any person from a Drop Down List and click the button "Save Changes".

Result:
- error message will appear in the web-browser (see "scrnshot_Web_Page_View_NoConverter_DateValue.JPG" and
"scrnshot_Web_Page_View_NoConverter_DateTimeValue.JPG")
Comment 1 _ alexpetrov 2007-06-19 16:15:32 UTC
Created attachment 43977 [details]
Project_screenshots
Comment 2 _ jimdavidson 2007-07-16 23:20:02 UTC
Created attachment 45173 [details]
Query Editor
Comment 3 _ jimdavidson 2007-07-16 23:47:10 UTC
Attachment was meant for another bug.  
Comment 4 _ jimdavidson 2007-07-19 21:01:13 UTC
There does appear to be a problem here.  Oracle does a number of non-standard things with dates, so a fix may involve
new code.  Until I dig into it, I can't say whether we can do it for 6.0.
Comment 5 _ jimdavidson 2007-08-01 23:50:11 UTC
Workaround is to run the Oracle Driver in V8 Compatibility mode, as described in:

http://wiki.netbeans.org/wiki/view/VwpFAQOracleSqlDate

This causes Oracle Dates to be mapped in java.sql.Timestamps.  Not as elegant, but it works fine.

On that basis, lowering priority to P3; I will continue to look for a better solution.  I may eventually close the bug,
since we could document the workaround in the InsertUpdateDelete tutorial.
Comment 6 _ alexpetrov 2007-11-02 14:49:02 UTC
Suggested workaround with using approach, described in http://wiki.netbeans.org/wiki/view/VwpFAQOracleSqlDate,
definitely works.
The bug status is changed to FIXED.

Product Version: NetBeans IDE Dev (Build 200710291200)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b02
System: Windows XP version 5.1 running on x86
Comment 7 _ alexpetrov 2007-11-02 14:49:51 UTC
Verified on:
Product Version: NetBeans IDE Dev (Build 200710291200)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b02
System: Windows XP version 5.1 running on x86
Comment 8 John Baker 2007-11-05 18:20:01 UTC
Nothing was fixed in the IDE so this cannot be marked as fixed.
It doesn't seem possible to add a warning to the user, so I think it's ok to mark as WILLNOTFIX

There should be an FAQ that points to this workaround

Comment 9 John Baker 2007-11-05 18:20:52 UTC
marking as WONTFIX as this is an Oracle limitation so there's nothing in NetBeans that can be done to fix this.
Comment 10 David Vancouvering 2007-11-05 20:30:21 UTC
John, could you provide a more detailed explanation of what the problem is here?  What is going wrong?  Using
v8compatibility works, but I can see this having a lot of other side effects, as it basically degrades your database
functionality for NetBeans to version 8.
Comment 11 John Baker 2007-11-06 07:19:13 UTC
desc5 and desc6 do sound contradictory

So far what I see is when a component is bound to a dataprovider field key of type Date, not TimeStamp
at runtime, Oracle complains that the type is not a valid SQL type.

In this project, a TextField is bound to the DepDate field.  To retrieve and store a date instead of a timestamp, an
SQLDateConverter is applied to the TextField.

I'll see if any workaround can be applied to CachedRowSetXImpl5 or related.  If not then the workaround describe will
have to do.