470,612 Members | 2,259 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,612 developers. It's quick & easy.

LOAD doesn't seem to work using JDBC

When I execute the following statment using the Command Center it

LOAD CLIENT FROM 'Y:\\TheFixedWidthData.txt' OF ASC METHOD L ( 1 1,2

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

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

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


Nov 12 '05 #1
3 2158
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
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


Nov 12 '05 #3

'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,

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Trevor Fairchild | last post: by
1 post views Thread by sufia | last post: by
reply views Thread by JohnLH | last post: by
2 posts views Thread by sea | last post: by
12 posts views Thread by Rhino | last post: by
6 posts views Thread by Chris Burnley | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.