⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gridtree.java

📁 有关JDBC的使用一些编程实例,有关与数据库连接的代码
💻 JAVA
字号:
/* * 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.*;public class gridtree {    /**   *    * instantiate the jdbcJTable 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").newInstance();               // the tinySQL textFile driver      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance(); // JDBC-ODBC bridge      Class.forName("com.sybase.jdbc.SybDriver").newInstance();    // Sybase      Class.forName("com.imaginary.sql.msql.MsqlDriver").newInstance();    // 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 an jdbcJTable object and add it to the frame    //    String column_list = "name, tree_id, parent_id";    jdbcJTable grid =       new jdbcJTable(argv[0], user, pwd, "tree", column_list, "tree_id");     }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -