<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 周銳 閱讀(342) 評論(0)  編輯  收藏 所屬分類: Java
    主站蜘蛛池模板: 亚洲色大成网站www永久网站| 69视频在线观看高清免费| 亚洲综合图片小说区热久久| 亚洲成a人片在线观看老师| 国产男女爽爽爽爽爽免费视频| aa级女人大片喷水视频免费| 亚洲av永久无码天堂网| 亚洲日韩中文字幕天堂不卡| 亚洲国产精品无码成人片久久| 免费人成视频x8x8入口| 久久WWW免费人成人片| 亚洲一级毛片免费观看| 怡红院免费全部视频在线视频| 老司机精品视频免费| 中文字幕乱码亚洲精品一区| 亚洲精品视频久久| 亚洲AV永久无码精品| 亚洲午夜久久久影院| 亚洲一级片内射网站在线观看| 四虎永久成人免费影院域名| 四虎影视www四虎免费| 天天摸天天操免费播放小视频| 99久久久精品免费观看国产| 在线看无码的免费网站| 久久精品免费电影| 精品免费tv久久久久久久| 免费人成在线观看视频高潮| 成人无码精品1区2区3区免费看| 一级毛片a免费播放王色| 免费很黄无遮挡的视频毛片| 男女交性无遮挡免费视频| 美女啪啪网站又黄又免费| 深夜特黄a级毛片免费播放| 免费一级毛片在线播放视频免费观看永久 | 免免费国产AAAAA片| 四虎免费影院ww4164h| 99精品国产免费久久久久久下载 | 亚洲高清在线mv| 亚洲短视频在线观看| 久久精品国产亚洲αv忘忧草| 亚洲娇小性色xxxx|