<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无码专区亚洲AV毛网站| 亚洲av色香蕉一区二区三区| 免费人成在线观看网站品爱网日本| 久久99久久成人免费播放| 亚洲国产美女视频| 免费不卡中文字幕在线| 小日子的在线观看免费| 亚洲欧美日韩中文二区| 国产亚洲精品a在线无码| 成人免费毛片内射美女APP| 久久九九久精品国产免费直播| 亚洲一卡2卡3卡4卡乱码 在线| 国产亚洲老熟女视频| 成人免费午夜无码视频| 99久久成人国产精品免费| 在线精品亚洲一区二区| 精品国产_亚洲人成在线高清| 无码高潮少妇毛多水多水免费| a级男女仿爱免费视频| 亚洲国产美女精品久久久| 亚洲av无码国产精品夜色午夜| 色播在线永久免费视频| 久久永久免费人妻精品下载| 免费一级毛片在线播放放视频| 亚洲成人免费电影| 亚洲成a人片在线观看无码专区| 日韩视频免费在线| 我的小后妈韩剧在线看免费高清版| 国产激情久久久久影院老熟女免费 | 亚洲第一黄片大全| 国产卡二卡三卡四卡免费网址| 两性色午夜免费视频| 精品一区二区三区免费毛片| 亚洲精品视频在线观看免费| 亚洲中文久久精品无码| 免费国产不卡午夜福在线 | 亚洲AV综合色区无码另类小说 | 亚洲午夜国产精品无码老牛影视| 在线免费观看一级片| 1000部羞羞禁止免费观看视频|