472,958 Members | 2,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

LOAD doesn't seem to work using JDBC

When I execute the following statment using the Command Center it
works:

LOAD CLIENT FROM 'Y:\\TheFixedWidthData.txt' OF ASC METHOD L ( 1 1,2
11,12 17) REPLACE INTO S00.TheTargetTable NONRECOVERABLE WITHOUT
PROMPTING

Yet when I try to execute the same statement in a PreparedStatement it
does not work, but gives me a SQLException:

DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: LOAD CLIENT
FROM 'Y:\\TheFixedWidthData.txt' OF ASC ME;BEGIN-OF-STATEMENT;<values>

My analysis so far:

(1) The Command Center says it uses a JDBC connection. So it must be
possible to do this using a JDBC connection, or more specifically, a
DB2Connection.

I have been using a type 4 connection so far, and over that connection
I executed other statements successfully (some selects with DB2
specific options).

(2) The Command Center understands and executes the Statement. So the
SQLException shown above doesn't make much sense to me, as the manual
says it basically means: "Syntax Error in Statement".

RTFM pointers anyone?

Kind regards

Claus

Nov 12 '05 #1
3 2267
JDBC is all about SQL, LOAD is a db2 utility, not SQL.
That is why.

Nov 12 '05 #2
I see.

Given the output of the command center saying "established JDBC
connection" I was mislead into believing the LOAD statement had been
executed as a DB2 specific statement via the JDBC connection the
command center initially established to the database I connect to. I
guess I am not the only person who ran into this...

So the command center simply filters the commands entered for LOAD
statements. When it finds one it runs "the external DB2 UDB LOAD
utility"?
From the wording "DB2 UDB LOAD utility" I would have expected to find

something like db2load.exe on the client and the server alike. But
there's nothing like that to find there, neither on the client, nor on
the server. Instead, it seems to me like the "DB2 UDB LOAD utility" is
an integral part of db2.exe? [I successfully executed LOAD commands I
put in a file using 'db2.exe -tvf theCmdFile.txt'].

"The DB2 UDB LOAD utility" is described in Chapter 3 of the Data
Movement Utilities Guide And Reference. Starting on p134, the "Command
syntax" for LOAD is described. But I couldn't find any explicit
information there on what the concrete physical representation of "the
DB2 UDB LOAD utility" was, and I would like to know :-)

Kind regards & thank you

Claus

Nov 12 '05 #3
Claus,

'db2' is an interpreter, which can understand different languages:

1) SQL, and
2) DB2 Commands, which often are the easies way to invoke database API.
Changing db parameters has nothing to SQL: you cannot prepare it,
connection to db is not required [sometimes].

If you are new to db2 world browse DB2 Information Center Reference to
discover what is a command and what is SQL.

Fruitfull reading,
A.

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Trevor Fairchild | last post by:
I am making a program that categorizes pictures. The picture paths are stored in an Access Database, vb6 connects using adodc controls. This program works specifically with .jpg files. It will be...
1
by: sufia | last post by:
hi, Everytime i try to run the following code (which is a part of my servlet): try { Class.forName( "oracle.jdbc.driver.OracleDriver" ); DriverManager.registerDriver(new...
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...
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...
12
by: Rhino | last post by:
I am having an odd problem: the sqlj command on my system doesn't work. I am running DB2 (LUW) V8 (FP8) on WinXP. I haven't done an sqlj program since Version 6 of DB2 (LUW) so I checked the...
1
by: bruce_milner | last post by:
I am having a problem using DB2 for z/OS Visual Explain V8 for Windows. The error message is: Fail to load JDBC driver COM.ibm.db2.jdbc.app.DB2Driver I have un-installed/re-installed DB...
3
by: nsh | last post by:
mailing.database.mysql, comp.lang.php subject: does "LOAD DATA" EVER work?!? I've tried EVERYTHING! version info: my isp is running my web page on a linux box with php ver. 4.4.1 according to...
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...
6
by: Chris Burnley | last post by:
We're seeing very strange behaviour with db2 under heavy load. We're running our system in GMT and the timezone never changes for British Summer Time. Basically the thing we're doing is (using...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.