aspose file tools*
The moose likes JDBC and the fly likes SQLServer to DB2(AS/400) export Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQLServer to DB2(AS/400) export" Watch "SQLServer to DB2(AS/400) export" New topic
Author

SQLServer to DB2(AS/400) export

Jerome Donaldson
Greenhorn

Joined: May 11, 2005
Posts: 13
Class 1 newbie, AS/400 programmer learning Java(And I like java)

Does anyone have any examples of using 1 jdbc to build a result set(for example sql server) but write back the result set with another jdbc(for example DB2/400)

Or is there some other way of doing this. Im having to extract data from MSSQL to be processed on the 400.

Thanks in advance all

Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

Ty,
Welcome to JavaRanch!

Any reason not to do a table export (to comma separated value format) and then a table import on the new database?

If you need to do this with JDBC, you need to use two sets of connections/statements/resultsets so you can read a record/write a record (or batches of records) at the same time.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jerome Donaldson
Greenhorn

Joined: May 11, 2005
Posts: 13
Hi,

Im doing that now, but was looking for a way to make it a 1 step process.

If you have any examples of such a connection I could sure use it.

Im confused about how to use the forClass or DriverManager with 2 drivers.

Thank You for Any help ... :-)
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

Ty,
If you put it in a shell script, it's one step .

There's nothing special about Class.forName or DriverManager. You use the same code with a different driver class name. Then you get two connection, one each. Basically, you have all the JDBC code twice. Note that this solution is much more complicated than the command line export/import. It's also likely to be significantly less efficient.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQLServer to DB2(AS/400) export