× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



The SQL Server equivalent is BULK INSERT.
I create an export file (CPYTOIMPF)
cmd = 'CpyToImpf FromFile(JDBC2TEST) '
+ ' ToStmf(' + '''' + path + filename + '''' + ')'
+ ' StmfCodPag(*PCASCII)'
+ ' StrDlm(*NONE)'
+ ' RcdDlm(' + '*CRLF' + ')'
+ ' FldDlm(' + '''|''' + ')';
QCmdExc( cmd : %Len( %Trimr( cmd ) ) );

And use this file in the BULK INSERT statement

stmt = 'BULK INSERT dbo.Phones '
+ ' FROM ' + qt + path + filename + qt
+ ' WITH '
+ ' ( '
+ ' FIELDTERMINATOR = ' + qt + '|' + qt + ', '
+ ' ROWTERMINATOR = ' + qt + '\n' + qt
+ ' )';
rc = jdbc_ExecUpd( conn : stmt);

HTH,

Rob

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Wilt, Charles
Sent: March 27, 2008 2:11 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: JDBCR4:Can't connect,not sure how to get full java error text

If I understand, you're inserting from RPG to an SQL server, correct?

Are you inserting only 1 row at a time? If so, that'd be a problem.

IBM's DB2 driver has an property, "use block insert=" that helps without
changing the app. Your SQL
Server driver may have a similar option.

Otherwise, you should be able to manually block the inserts, but that
probability have to be done all
in Java, unless you added some code your RPG program could make use of.

HTH,

Charles Wilt
Software Engineer
CINTAS Corporation - IT 92B
513.701.1307

wiltc@xxxxxxxxxx


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Tony Carolla
Sent: Thursday, March 27, 2008 1:54 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: JDBCR4:Can't connect,not sure how to get full java error text

Well, performance-wise with jTDS, the story doesn't seem to be pretty, but
I
am new to using java with RPG.

I have a 499 record length file with 97 fields of data. I created a
simple
program to prepare an INSERT statement (now complete with closing
parens), read from the input file, with maximized blocking through
OVRDBF SEQONLY(*YES n), set the prepared fields using the JDBC_set___ ops,
and execute the statement. After 00:12:36, I had inserted only 9042
records. That's just under 12 rows per second. These servers are
connected
via 100 ethernet, and I was hoping it would go faster. I might have to
resort to pure java to get the performance I need, but this seems silly to
me. I know that the RPG isn't slowing me down. And I know that the SQL
server isn't a slow one.

I will continue to try and get the MS JDBC driver working, so that I can
see
if the slowdown is due to jTDS. It sure is quick when performing
immediate
queries...
On Tue, Mar 25, 2008 at 3:46 PM, Robert Rogerson
<robertrogerson@xxxxxxxxxx>
wrote:

HI Tony, I definitely would be interested in your results as to the
performance of the jTDS Level 4 Driver.
We are still in the testing phase of an application that both reads and
inserts records into an SqlServer DB and performance may be an issue.
If it is found to be faster than maybe I will switch.
I will be sure to let you know of my test results.

Regards,

Rob Rogerson
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-
bounces@xxxxxxxxxxxx]
On Behalf Of Tony Carolla
Sent: March 25, 2008 5:25 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: JDBCR4:Can't connect,not sure how to get full java error
text

We already have the latest service packs on our 2000 and 2005 SQL
Servers,
but I am not sure if that was the problem. I tried playing with the
'encrypt' property (which is 'false', by default), and I even tried
setting
all other SSL properties off. All to no avail.

So I tried the jTDS Level 4 Driver, found on sourceforge, and the
connection
works fine. I have played around with this driver, but not from RPG.
This
is supposedly the most performant driver for SQL server (so the writers
say
anyway). Has anyone had any experience using JDBCR and this driver? I
will
play with some SELECTs and INSERTs, and let you know my results.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




--
"For everyone who exalts himself will be humbled, but the one who humbles
himself will be exalted." Luke 18:14
"Some days you are the bug, some days you are the windshield" - unk
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




This e-mail transmission contains information that is intended to be
confidential and privileged. If you receive this e-mail and you are not a
named addressee you are hereby notified that you are not authorized to read,
print, retain, copy or disseminate this communication without the consent of
the sender and that doing so is prohibited and may be unlawful. Please
reply to the message immediately by informing the sender that the message
was misdirected. After replying, please delete and otherwise erase it and
any attachments from your computer system. Your assistance in correcting
this error is appreciated.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.