亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? jdbcmlgrid.java

?? 一系列實現JDBC的演示類
?? JAVA
字號:
/* * * jdbcMlGrid * * An extension of the MlGrid object which allows * in-place editing of a table. * * Copyright 1996 John Wiley & Sons, Inc. All Rights Reserved. Reproduction * or translation of this work beyond that permitted in Section 117 of the 1976 * United States Copyright Act without the express written permission of the * copyright owner is unlawful. Requests for further information should be  * addressed to Permissions Department, John Wiley & Sons, Inc. The  * purchaser may make back-up copies for his/her own use only and not for  * distribution or resale. The Publisher assumes no responsibility for errors,  * omissions, or damages, caused by the use of this  software or from the use * of the information contained herein. * */import java.awt.*;import mlsoft.mct.*;import java.sql.*;import java.util.*;public class jdbcMlGrid extends MlGrid {  // a JDBC connection, and a Statement object  //  Connection con;  Statement stmt;  String table, column_list, pkey;  int pkey_col;  /**   *   * Constructs a new jdbcMlGrid object.   * @param url a URL to a valid JDBC data source.   * @param user a username   * @param pwd a password   * @param tbl the table to edit   * @param cols a comma-delimited list of columns to view   * @param pk the name of the primary key   *   */  public jdbcMlGrid(String url, String user, String pwd,                     String tbl, String cols, String pk) {    table       = tbl;    column_list = cols;    pkey        = pk;    // invoke the connect() method    //    connect(url, user, pwd);    // do some preliminary grid setup    //    prepareGrid();    // retrieve the data    //    getData();    // do some more grid setup    //    layoutGrid();    // Add a listener for grid events.    //    addMlGridListener( new GridEventHandler() );  }  /*   *   * make a JDBC connection.   *   */  public void connect (String url, String user, String pwd) {    try {      // ask the DriverManager to find      // a suitable driver for this URL.      //      con = DriverManager.getConnection(url, user, pwd);      // create a statement object. This is the      // gateway into the world of playing      // with fun things like SQL statements      // and results      //      stmt = con.createStatement();          } catch (Exception e) {      e.printStackTrace ();    }  }    public void prepareGrid () {    MlResources res;    Font boldFont;    res = new MlResources();    this.setValue("layoutFrozen", true);    res.add("hsbDisplayPolicy", "DISPLAY_ALWAYS");    res.add("vsbDisplayPolicy", "DISPLAY_ALWAYS");    res.add("highlightRowMode", false);    res.add("selectionPolicy", "SELECT_CELL");    res.add("allowColumnResize", false);    res.add("allowRowResize", false);    res.add("shadowThickness", 1);    this.setValues(res);    res.clear();    res.add("cellDefaults", true);    res.add("cellEditable", true);    res.add("cellAlignment", "ALIGNMENT_LEFT");    res.add("cellBackground", "#ffffff");    res.add("cellLeftBorderType", "BORDER_NONE");    res.add("cellTopBorderType", "BORDER_NONE");    this.setValues(res);    this.setValue("layoutFrozen", false);  }  public void layoutGrid() {    MlResources res;    Font boldFont;    boldFont = new Font("Helvetica", Font.BOLD, 12);    res = new MlResources();    this.setValue("layoutFrozen", true);    res.clear();    res.add("rowType", "ALL_TYPES");    res.add("columnType", "HEADING");    res.add("column", 0);    res.add("cellAlignment", "ALIGNMENT_CENTER");    res.add("cellBackground", "#c0c0c0");    res.add("cellFont", boldFont);    res.add("cellLeftBorderType", "BORDER_LINE");    res.add("cellTopBorderType", "BORDER_LINE");    this.setValues(res);    res.clear();    res.add("rowType", "HEADING");    res.add("row", 0);    res.add("cellAlignment", "ALIGNMENT_CENTER");    res.add("cellBackground", "#c0c0c0");    res.add("cellFont", boldFont);    res.add("cellLeftBorderType", "BORDER_LINE");    res.add("cellTopBorderType", "BORDER_LINE");    this.setValues(res);    this.setValue("layoutFrozen", false);  }  /**   * getData()   *   */  protected void getData() {    ResultSet rs;    try {      this.setValue("layoutFrozen", true); // freeze the layout      // retrieve all rows from the table.      //      rs = stmt.executeQuery("SELECT " + column_list + " FROM " + table);      // get a ResultSetMetaData object      //      ResultSetMetaData meta = rs.getMetaData();      // a resource object to manipulate the grid      //      MlResources res = new MlResources();      Vector rows = new Vector(); // a Vector to contain each row      int i;      int rowcount = 0;      // process the result set      //      while (rs.next()) {        rowcount++;        // create an array of columns; this will hold the        // String objects corresponding to each column,        // and will be inserted into the rows Vector.        //        String[] columns = new String[meta.getColumnCount()];        // store the value of each column        //        for (i = 1; i <= meta.getColumnCount(); i++) {          columns[i - 1] = rs.getString(i);        }        rows.addElement(columns);      }      // use the resource object to add heading rows, heading      // columns, and to set the number of columns and rows      // according to the number of columns and rows in the      // result set.      //      res.clear();      res.add("headingRows", 1);      res.add("headingColumns", 1);      res.add("columns", meta.getColumnCount());      res.add("rows", rowcount);      this.setValues(res);      // loop for each column. Here, the column headers      // will be set to have the correct title and width.      //       for (i = 1; i <= meta.getColumnCount(); i++) {        // get the column name        //        String col_name = meta.getColumnName(i);        // set the string of the column header        //        this.setStrings(MlGrid.HEADING, 0, MlGrid.CONTENT, i - 1, col_name);        // determine a suitable column width: the greater        // of the column's display size or the size of        // its column name.        //        int size = Math.max(meta.getColumnDisplaySize(i), col_name.length());        // prepare the resource object to set the column width        //        res.clear();        res.add("column", i - 1);        res.add("columnWidth", size);        // if this column is the primary key, make it non-editable,        // and store the index in the pkey_col field.        //        if (col_name.equals(pkey)) {          res.add("cellEditable", false);          pkey_col = i - 1;        }        this.setValues(res);      }      // set each column value on a row by row basis      //      int j;      for (j = 0; j < rows.size(); j++) {        // number each row        //        this.setStrings(MlGrid.CONTENT, j, MlGrid.HEADING, 0,          Integer.toString(j + 1));        // get the column array from the rows Vector        //        String[] columns = (String[]) rows.elementAt(j);        // add each column's value to the grid        //        for (i = 0; i < columns.length; i++) {          res.clear();          res.add("column",     i);          res.add("row",        j);          res.add("cellString", columns[i]);          this.setValues(res);        }      }             this.setValue("layoutFrozen", false);    } catch (SQLException e) {      SQLErr(e);    }  }    /**   *    * instantiate the jdbcMlGrid object with test data.   *   */  public static void main (String argv[]) {        try {      // register all of the JDBC classes you might use      // you can comment out or remove the ones you      // are not using.      //      Class.forName("textFileDriver");            // the tinySQL textFile driver      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");  // JDBC-ODBC bridge      Class.forName("COM.imaginary.sql.msql.MsqlDriver"); // mSQL          } catch (Exception e) {      e.printStackTrace();    }    if (argv.length == 0) {        System.out.println("You must supply a URL to a JDBC data source.");        System.out.println("");        System.out.println("Example:");        System.out.println("java DDL jdbc:odbc:DATA_SOURCE_NAME;" +                           "UID=userid;PWD=password");      System.exit(0);    }    // the user might have passed in a user name or password,    // so try to read those in, as well    //    String user, pwd;    if (argv.length > 1) {      user = argv[1];    } else {      user = "";    }    if (argv.length > 2) {      pwd = argv[2];    } else {      pwd = "";    }    // create a myFrame object that knows how to close itself    //    myFrame f = new myFrame();    f.setLayout(new BorderLayout());    // create an MlGrid object and add it to the frame    //    String column_list = "name, address, city, state, zip, country, phone, id";    jdbcMlGrid grid =       new jdbcMlGrid(argv[0], user, pwd, "cardfile", column_list, "id");    f.add("Center", grid);    f.setTitle("cardfile");    // resize and show the frame    //    f.setSize(400, 300);    f.show();         }  /**   *   * mindless error handler which prints out state, message,   * and vendor info for SQL errors.   */  public void SQLErr(SQLException e) {    while (e != null) {      System.out.println("SQLState: " + e.getSQLState());      System.out.println("Message:  " + e.getMessage());      System.out.println("Vendor:   " + e.getErrorCode());      e.printStackTrace();      e = e.getNextException();      System.out.println("");    }  }  /**   * A listener for the Grid Events   *   */  class GridEventHandler implements MlGridListener {    public void onGridEvent(MlGridEvent event) {      if(event.getType() == MlGridEvent.EDIT_COMPLETE) {        // get the column name that was edited        //        String column_name = (String)          getCellValue(MlGrid.HEADING, 0, MlGrid.CONTENT,                        event.column, "cellString");        // get the column value        //        String column_val = (String)          getCellValue(event.row, event.column, "cellString");        // get the value of this row's primary key        //        String pkey_val = (String)          getCellValue(event.row, pkey_col, "cellString");        // construct an SQL UPDATE statement        //        String update = "UPDATE " + table +                         " SET " + column_name + " = '" + column_val + "' " +                        " WHERE " + pkey + " = " + pkey_val;            // issue the UPDATE        //        try {          stmt.executeUpdate(update);        } catch (SQLException e) {          SQLErr(e);        }      }    }  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人性生交大片免费看中文| 亚洲少妇30p| 欧美日韩精品福利| 9191国产精品| 欧美群妇大交群的观看方式| 91福利视频网站| 91福利资源站| 欧美日韩三级一区二区| 欧美性大战xxxxx久久久| 欧美在线看片a免费观看| 在线精品亚洲一区二区不卡| 在线观看欧美黄色| 日韩一级片网址| 国产欧美日韩亚州综合| 国产精品天美传媒| 亚洲精品自拍动漫在线| 亚洲高清不卡在线| 日本亚洲天堂网| 久久久www成人免费无遮挡大片| 综合久久给合久久狠狠狠97色| 亚洲欧美自拍偷拍色图| 久久久久久久久久久久久女国产乱| 成人av在线影院| 国产一区91精品张津瑜| 欧美精品久久久久久久多人混战| 日韩午夜在线观看视频| 国产女主播在线一区二区| 欧美一区二区精品久久911| 欧美一区二区三区免费视频| 精品久久久久一区二区国产| 欧美性猛交xxxx黑人交| 欧美一级欧美三级| 欧美亚洲国产一区二区三区 | 欧美日韩国产免费一区二区 | 91老师国产黑色丝袜在线| 69成人精品免费视频| 欧美老年两性高潮| 一区二区在线观看av| 91麻豆精品国产91久久久久久久久 | 亚洲狼人国产精品| 亚洲一区中文日韩| 国内成人自拍视频| 欧美色图免费看| 中文字幕制服丝袜一区二区三区 | 九九九久久久精品| 色婷婷综合久久久久中文| 精品久久五月天| 亚洲夂夂婷婷色拍ww47| 粉嫩绯色av一区二区在线观看 | 中文字幕在线播放不卡一区| 视频一区欧美精品| 一本久道中文字幕精品亚洲嫩| 精品国产不卡一区二区三区| 夜夜精品浪潮av一区二区三区| 国产一区二区三区免费在线观看| 在线视频一区二区免费| 欧美国产精品专区| 精品亚洲欧美一区| 日韩视频一区二区三区在线播放 | 欧美一区二区三区四区五区| 亚洲精选在线视频| 99在线精品观看| 中文文精品字幕一区二区| 美脚の诱脚舐め脚责91| 欧美电影一区二区三区| 亚洲国产日韩一级| 欧洲精品在线观看| 亚洲综合精品自拍| 91久久精品一区二区三区| 中文字幕在线一区免费| 成人免费看黄yyy456| 国产欧美日韩精品a在线观看| 狠狠色丁香久久婷婷综合_中 | 日本美女一区二区三区视频| 欧美亚洲另类激情小说| 亚洲不卡一区二区三区| 欧美精品日韩一本| 婷婷丁香久久五月婷婷| 欧美日韩亚洲综合一区| 水蜜桃久久夜色精品一区的特点| 欧美日本一区二区三区四区| 午夜精品一区二区三区电影天堂 | 亚洲女同一区二区| 99精品一区二区三区| 亚洲女爱视频在线| 欧美午夜寂寞影院| 视频在线观看一区二区三区| 欧美一区二区三区四区视频| 久久精品国产网站| 国产欧美日韩一区二区三区在线观看 | 欧美日韩亚洲综合| 毛片不卡一区二区| 久久精品亚洲一区二区三区浴池| 成人黄色av电影| 亚洲黄一区二区三区| 91麻豆精品国产自产在线观看一区| 蜜桃av一区二区三区电影| 久久久精品天堂| 97久久超碰国产精品| 亚洲3atv精品一区二区三区| 欧美大片免费久久精品三p| 国产风韵犹存在线视精品| 专区另类欧美日韩| 日韩欧美国产精品一区| 成人精品免费网站| 午夜精品福利一区二区蜜股av | 亚洲欧洲制服丝袜| 欧美一区二区三区人| 粉嫩绯色av一区二区在线观看| 亚洲免费观看在线视频| 欧美美女一区二区| 成人在线综合网| 日韩av网站在线观看| 日本一区二区视频在线观看| 欧美日韩精品一区二区天天拍小说| 激情小说亚洲一区| 亚洲成人高清在线| 国产精品久久久久久久久图文区| 欧美日韩中文字幕一区二区| 国产乱码一区二区三区| 亚洲综合在线第一页| 26uuu成人网一区二区三区| 欧美久久一区二区| 99国产精品国产精品毛片| 久久精品噜噜噜成人88aⅴ| 国产精品情趣视频| 日韩一区二区影院| 欧美日本国产视频| 91九色最新地址| 成人av影视在线观看| 国产在线精品一区二区不卡了| 亚洲国产aⅴ成人精品无吗| 中文字幕一区二区三区蜜月| 26uuu精品一区二区| 久久久久久**毛片大全| 精品久久久久av影院| 欧美日韩黄色一区二区| 久久99久久久久| 国产精品久久国产精麻豆99网站| 欧美日韩激情一区二区| 91麻豆国产福利在线观看| 一区二区三区在线播| 91国偷自产一区二区开放时间 | 国产麻豆精品在线观看| 黄色小说综合网站| 在线观看欧美黄色| 欧美最新大片在线看| 91福利视频久久久久| 91理论电影在线观看| 91在线观看视频| 欧美亚洲国产一卡| 欧美精品一区男女天堂| 国产日韩欧美精品电影三级在线| 久久久蜜桃精品| 自拍偷自拍亚洲精品播放| 视频在线在亚洲| 成人中文字幕电影| 欧美日韩精品一区二区在线播放| 在线不卡一区二区| 国产精品不卡视频| 精品一区二区三区久久| 一本色道久久综合亚洲91 | 福利电影一区二区| 欧美视频三区在线播放| 国产午夜亚洲精品羞羞网站| 亚洲视频你懂的| 激情六月婷婷久久| 欧美性三三影院| 国产精品久久久久影院亚瑟| 同产精品九九九| 在线视频中文字幕一区二区| 欧美日韩一区不卡| 日本高清不卡aⅴ免费网站| 久久精品国产网站| 国产一区二区三区四| 福利电影一区二区| 91麻豆蜜桃一区二区三区| 99re热这里只有精品免费视频 | 国产欧美日韩另类一区| 久久久久久免费毛片精品| 久久这里都是精品| 亚洲午夜激情av| 久久精品理论片| 99国产精品久久| 8x8x8国产精品| 中文字幕精品一区二区三区精品| 国产亚洲一区二区在线观看| 国产精品电影一区二区| 亚洲18色成人| eeuss鲁片一区二区三区 | 国产欧美va欧美不卡在线| 亚洲免费在线电影| 国产一区二区网址| 欧美日韩一区二区电影| 久久久久国产精品厨房| 91成人看片片| 日本一区二区三区在线观看| 亚洲成人av一区| 日本视频一区二区三区| 波多野结衣91|