473,379 Members | 1,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

DB2 Bulk Load via Java/JDBC

Hello forum!

I am stuck with this problem since 2 days now, and have no idea how to solve my problem.
I have a txt-file which looks like the following:
2199049812488;2201195906184;com/ibm/icu/util/ByteArrayWrapper;12;0;1942244464;
2199049813048;2199049812488;com/ibm/icu/text/RawCollationKey;12;0;1945488496;
2199049813608;2201195906184;com/ibm/icu/impl/RuleCharacterIterator;40;0;1944538224;
2199049814168;2201195906184;com/ibm/icu/text/UnicodeSet$Filter;0;0;1880149104;
2199049814728;2201195906184;com/ibm/icu/text/UnicodeMatcher;0;0;1879198832;
.
.
.


As you can see, it looks like some kind of csv-file.
I have now a line of code that bulk-inserts this txt-file quite fine, when i use it on the db2-console.
LOAD FROM 'D:/classDump.txt' OF DEL MODIFIED BY COLDEL; INSERT INTO classDump;

But now, when I try to run this command as query through JDBC, meaning as parameter of the #execute() method, I'll get an error which looks like this:
com.ibm.db2.jcc.a.rm: DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=DB2 LOAD CLIENT FROM 'D:/classDump.txt' OF ;BEGIN-OF-STATEMENT;<space>, DRIVER=4.0.100

Can anyone please explain me what I am doing wrong?

Thank you and best regards,
MHR
Sep 22 '08 #1
3 8506
earl60
2
Replace COLDEL;
by COLDEL0x3B
; is interpreted as a command delimiter...
Oct 31 '08 #2
kazam
9
See if the sample code snippet for LOAD operation in sqllib/samples/java/jdbc/SetIntegrity.java helps.


Thanks,
Madhavi.
Oct 31 '08 #3
docdiesel
297 Expert 100+
Hi,

I'm sorry to say so but LOAD won't work through JDBC. It no SQL but a CLI command which will be accepted by the DB2 command line interface only.

Regards

Doc Diesel
Nov 12 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: JShurmatz | last post by:
If anyone can shed some light on this problem I would greatly appreciate it. I am unsuccessfully trying to use a database connnection retrieved from a pool configured using Java System Web...
1
by: CM | last post by:
Hi, when i want connect me in my BD with a JSP (with this simple code), this exception is throw. Thank's for ur help Mathieu CODE of my JSP ---------------------
0
by: JohnLH | last post by:
Hi, I am having an issue with the LOAD DATA LOCAL FILE command on the latest 3.0.9 JDBC Driver. The command works on Windows, but doesn't seem to work on OSX and Linux. The error that I get on...
3
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my...
2
by: sea | last post by:
I have DB2 UDB Workgroup version 7.2 -- the JDBC-ODBC bridge loads perfectly fine but when I try to use JDBC I get an error, copying and pasting below. I added db2java.zip and db2jdbc.dll to both...
10
by: technocrat | last post by:
Hi, I am trying to declare and cursor and thn load from that cursor into another table. Since I have almost 4 million records, I cant do it without the cursor which reduces the time by almost...
2
by: astolpho | last post by:
I am using a slightly outdated reference book on J2EE programming. It gives 2 methods of creating a database used in its casestudies. The first is an ANT script that gives the following output: ...
0
oll3i
by: oll3i | last post by:
package library.common; import java.sql.ResultSet; public interface LibraryInterface { public ResultSet getBookByAuthor(String author); public ResultSet getBookByName(String name);
1
by: nickyeng | last post by:
imageValue=null SEVERE:--> com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column 'Gout_msgtext' cannot be null at...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.