File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Murach's Java Servlets and JSP this week in the Servlets 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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30068
    
149

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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30068
    
149

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.
 
 
subject: SQLServer to DB2(AS/400) export
 
Similar Threads
Need help
Using JDBC java code - how can I connect to IBM AS400 iSERIES to read data
can i use the resultset simultaneously?
Callable Statement with OUT parameter issue
JTA Problem in VAJ 4