Posted By

ejboy on 02/23/07


Tagged

database xml csv jdbc etl scriptella


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

ejboy
halbtuerke
vali29


Load CSV data into a database


 / Published in: XML
 

URL: http://snippets.dzone.com/posts/show/3508

This example demonstrates usage of Scriptella ETL Tool to load CSV data into a database table.

  1. <!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd">
  2. <etl>
  3. <connection id="in" driver="csv" url="data.csv" classpath="opencsv.jar"/>
  4. <connection id="out" driver="oracle" url="jdbc:oracle:thin:@localhost:1521:ORCL"
  5. classpath="ojdbc14.jar" user="scott" password="tiger"/>
  6. <!-- Copy all CSV rows to a database table -->
  7. <query connection-id="in">
  8. <!-- Empty query means select all columns -->
  9. <script connection-id="out">
  10. INSERT INTO Table_Name VALUES (?id,?priority, ?summary, ?status)
  11. </script>
  12. </query>
  13. </etl>

Report this snippet  

You need to login to post a comment.