https://bugs.documentfoundation.org/show_bug.cgi?id=54730

grofaty <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |WORKSFORME

--- Comment #14 from grofaty <[email protected]> ---
Hi,
after several years I desperately needed functionality to get access to DB2
database from LibreOffice Base and now I see it is working fine for me. It
looks like crash bug was intentionally/unintentionally fixed.

I did the following (just in case if someone else having the same problem):

SOFTWARE INSTALLATION
1. I Installed LibreOffice 5.2.4.2 on my Windows 7 SP1 computer so LibreOffice
executable is in path: C:\Programs\LibreOffice\program\sbase.exe
2. I Installed latest Java JRE from www.java.com into so Java executable is in
path: C:\Programs\Java\jre1.8.0_111\bin\java.exe
3. I have installed "IBM Data Server Runtime Client" (this is only DB2 client,
DB2 server is installed on another machine) and JDBC driver is in path:
C:\Programs\IBM\SQLLIB\java\db2jcc4.jar
Note: I have installed whole db2 runtime-client, because I need it for other
tasks, but in theory it is enough to only have db2jcc4.jar (JDBC driver) and
db2jcc_license_cu.jar (DB2 license file) files in one of the paths.

DB2 JDBC SETTINGS
4. I have opened LibreOffice main program (not Base yet) from path:
C:\Programs\LibreOffice4\program\soffice.exe
5. From menu Tools | Options click on + in front of LibreOffice and click on
Advanced option. Wait for few seconds and inside table Vendor="Oracle
Corporation" and "Version=1.8.0_111" is displayed (this is the Java installed
in step 2).
6. Inside table click on found Java and then click on "Class Path" button.
7. New dialog opens. Click on "Add Archive" button.
8. Point path to the DB2 JDBC driver in my case:
C:\Programs\IBM\SQLLIB\java\db2jcc4.jar
Note: Above setting must be set! If not, then later in the process when
connection userid/password is tested the error is displayed:
The driver class 'com.ibm.db2.jcc.DB2Driver' could not be loaded.
9. Click OK button and again OK button to accept changes and close down
dialogs.

CONNECTION TO DB2 DATABASE
10. Start LibreOffice Base.
11. Database Wizard dialog opens. Select "Connect to an existing database",
select JDBC from drop-down box and Next button.
12. In field where jdbc: is already hard coded type in:
db2://192.168.5.74:50000/SAMPLE
    General syntax: db2://<server>:<port>/<database_name>
13. In JDBC driver class type in: com.ibm.db2.jcc.DB2Driver and click on Test
Class button. Successful. Next button.
14. User name: <username> and check "Password required" box. Click on Test
Connection button and type in password. Successful. Next button.
15. Accept default ("yes, register the database for me" and "Open the database
for editing" and click Finish button.
16. Save As dialog appears. Select desired path and file name and click on Save
button. Wait few seconds and database tables appear in the Tables list.

EDIT THE DATA
17. Inside Tables window double click on table you would like to edit.
18. Table opens up. Now you can edit existing data in one of the fields (or
multiple fields in the same row). When you click on another cell inside the
same row the DB2 database does not get yet updated. But when clicked on
previous or next row or at the bottom at the last new row that triggers update
into DB2 database table. I have checked with DB2 database monitoring tool and I
see update SQL was executed running update on fields that I have changed and
where condition is primary key of the row in table. Excellent exactly like it
should be working.
19. In the last empty row type in some new values in all of the fields and then
click on some other row. This click on other row triggers insert statement in
table. Excellent, works exactly like it should.
20. In front of the table click on specific row (Shift key or Control key can
be used to mark several rows) and right click and select "Delete Rows".
Confirmation dialog appears. I have check with monitoring tool and for each
selected row delete statement is executed with where condition pointing to
primary key. Excellent exactly like it should be working.

DEBUGGING
21. For example in character(2) field try to type in three characters and click
on another row. Error is expected and it is displayed "Error updating the
current record" and SQLCODE=-302 is displayed. Looking into DB2 error codes it
is clear the correct error was displayed by LibreOffice.22. Similar if new
record is inserted for example with duplicate primary key "Error inserting the
new record" with SQLCODE=-803 is displayed. Also correct error, because this
sqlcode is for duplicate primary key. Works as expected. Excellent!

I am really glad LibreOffice Base is finally working perfectly with DB2.
Excellent!

P.S. I am marking this status bug from "RESOLVED:INVALID" into
"RESOLVED:WORKSFORME".

Thanks.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to