Subject:How to Insert To DB with Java Author:Homer Najafi Date:12 Jun 2006 02:07 PM
Hi All,
I am trying to convert a CSV file to XML (calling adaptor from java; already done this part) and then insert the generated XML file to a DataBase (Insert). Can someone points me to the right direction please (or a sample code even better). I can call a Query (Select) file (.rdbxml) file from Java but I can't do INSERT. I saw a movie clip teach you how to do it with with WebServices and XSLT but mine is a simple Console app with no XSTL.
Subject:How to Insert To DB with Java Author:Ivan Pedruzzi Date:15 Jun 2006 04:36 PM
Homer,
Please take a look to the chapter "Composing SQL/XML in Stylus Studio" in the product documentation.
Once you have defined the UPDATE part of your DB to XML Data Source you will be able to write XML into StylusFile OutputStream (StylusFile.getOutputStream())
Subject:How to Insert To DB with Java Author:Homer Najafi Date:16 Jun 2006 03:38 PM
Thanks Ivan. Is there any full example somewhere? I thought this is one of the major job people want to do with XML and Stylus.
I wanted to try your suggestion but I am keep getting following error message when I try to connect to DB2:
[StylusStudio][DB2 JDBC Driver]Unsupported VM encoding Cp500.
I am getting it after installing Stylus Release 3. I have jdk/jre 1.5.0_07 Multi-Language (that's the only one on Sun's site; no English-only; so the language is not the problem).
Subject:How to Insert To DB with Java Author:Ivan Pedruzzi Date:16 Jun 2006 03:51 PM
Please verify which JVM version Stylus Studio is using
(help -> about)?
Could you please check if under c:\Program Files\Java\jre1.5.0_06\lib
you have a file called charsets.jar?
If you don't you jave to re-install the JRE and during the process you need to turn on "support for additional languages".
Thank You for your help
Ivan Pedruzzi
Stylus Studio Team
Subject:How to Insert To DB with Java Author:Homer Najafi Date:19 Jun 2006 09:17 AM
Hi Minollo,
I've seen this clip already. The scenario I have is much simpler than this. No Web Services and no XSL. It's how to insert/update records in database from existing XML file.
Subject:How to Insert To DB with Java Author:Minollo I. Date:19 Jun 2006 09:25 AM
The concept is the same; provided that the XML is in the format the SQL/XML update portion expects (or that you created an XSLT/XQuery to make it look like what's expected), then you should be able to follow the same procedure.