<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 431,  comments - 344,  trackbacks - 0
     

    About 


    CsvJdbc is a simple read-only JDBC driver that uses Comma Separated Value (CSV) files as database tables. It is ideal for writing data importing programs

    How is it used


    The CsvJDBC driver is used just like any other JDBC driver. This example code shows how the driver is used.

    import Java.sql.*;

    public class DemoDriver

    {

     public static void main(String[] args)

     {

        try

        {

          // load the driver into memory

          Class.forName("org.relique.jdbc.csv.CsvDriver");

          // create a connection. The first command line parameter is assumed to

          // be the directory in which the .csv files are held

          Connection conn = DriverManager.getConnection("jdbc:relique:csv:" + args[0] );

          // create a Statement object to execute the query with

          Statement stmt = conn.createStatement();

          // Select the ID and NAME columns from sample.csv

          ResultSet results = stmt.executeQuery("SELECT ID,NAME FROM sample");

          // dump out the results

          while (results.next())

          {

            System.out.println("ID= " + results.getString("ID") + "   NAME= " + results.getString("NAME"));

          }

          // clean up

          results.close();

          stmt.close();

          conn.close();

        }

        catch(Exception e)

        {

          System.out.println("Oops-> " + e);

        }

     }

    }

    Advanced Options 


    The driver also supports a number of parameters that change the default behaviour of the driver.

    These properties are:

    separator

    Used to specify a different column separator (Default is ',').

    suppressHeaders

    Used to specify if the first line contains column header information (Default is false; column headers are on first line).

    fileExtension

    Used to specify a different file extension (Default is ".csv")

    This following example code shows how these properties are used.

     ...

     Properties props = new Java.util.Properties();

     props.put("separator","|");              // separator is a bar

     props.put("suppressHeaders","true");     // first line contains data

     props.put("fileExtension",".txt");       // file extension is .txt

     Connection conn = Drivermanager.getConnection("jdbc:relique:csv:" + args[0],props)

     ...

    Download 


    The latest version of the software can be found at http://www.sourceforge.net/projects/csvjdbc.

    posted on 2008-03-19 13:43 周銳 閱讀(335) 評論(0)  編輯  收藏 所屬分類: Java
    主站蜘蛛池模板: 亚洲av一本岛在线播放| 免费福利在线观看| 哒哒哒免费视频观看在线www | 亚洲s色大片在线观看| 五月婷婷在线免费观看| 久久精品国产亚洲av瑜伽| 国产亚洲婷婷香蕉久久精品 | 国产黄在线观看免费观看不卡 | 亚洲一区二区三区高清不卡| 免费午夜爽爽爽WWW视频十八禁| a级成人毛片免费视频高清| 亚洲宅男精品一区在线观看| 亚洲人成网站在线观看青青| 一区二区三区观看免费中文视频在线播放 | 亚洲综合精品一二三区在线| 最近中文字幕无吗高清免费视频| 五月婷婷免费视频| 亚洲欧洲另类春色校园网站| 国产午夜亚洲精品国产成人小说| 亚洲成人免费网址| 国产精品成人69XXX免费视频| 亚洲国产视频久久| 亚洲AV永久无码区成人网站 | 亚洲成人在线电影| 免费jjzz在在线播放国产| 国产免费女女脚奴视频网| 一级毛片免费在线| 亚洲狠狠色丁香婷婷综合| 18gay台湾男同亚洲男同| 亚洲美女在线国产| 免费特级黄毛片在线成人观看| 国产成人AV免费观看| 亚洲变态另类一区二区三区 | 亚洲国产成人精品无码区二本| 亚洲成AV人片在线观看无码| 亚洲AV无码乱码在线观看| 黄网站色在线视频免费观看| 少妇性饥渴无码A区免费 | 一级做性色a爰片久久毛片免费| 亚洲宅男精品一区在线观看| 久久亚洲春色中文字幕久久久|