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

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

?? makeapidb.java

?? 包括了19種Java技術的164個類源代碼
?? JAVA
字號:
/* * Copyright (c) 2000 David Flanagan.  All rights reserved. * This code is from the book Java Examples in a Nutshell, 2nd Edition. * It is provided AS-IS, WITHOUT ANY WARRANTY either expressed or implied. * You may study, use, and modify it for any non-commercial purpose. * You may distribute it non-commercially as long as you retain this notice. * For a commercial use license, or to purchase the book (recommended), * visit http://www.davidflanagan.com/javaexamples2. */package com.davidflanagan.examples.sql;import java.sql.*;import java.lang.reflect.*;import java.io.*;import java.util.*;/** * This class is a standalone program that reads a list of classes and  * builds a database of packages, classes, and class fields and methods. **/public class MakeAPIDB {    public static void main(String args[]) {        Connection c = null;       // The connection to the database        try {             // Read the classes to index from a file specified by args[0]            ArrayList classnames = new ArrayList();            BufferedReader in = new BufferedReader(new FileReader(args[0]));            String name;            while((name = in.readLine()) != null) classnames.add(name);                        // Now determine the values needed to set up the database            // connection The program attempts to read a property file named            // "APIDB.props", or optionally specified by args[1].  This            // property file (if any) may contain "driver", "database", "user",            // and "password" properties that specify the necessary values for            // connecting to the db.  If the properties file does not exist, or            // does not contain the named properties, defaults will be used.            Properties p = new Properties();          // Empty properties            try {                                     		p.load(new FileInputStream(args[1])); // Try to load properties	    }             catch (Exception e1) {                 try { p.load(new FileInputStream("APIDB.props")); }                catch (Exception e2) {}            }             // Read values from Properties file            String driver = p.getProperty("driver");            String database = p.getProperty("database");            String user = p.getProperty("user", "");            String password = p.getProperty("password", "");	    // The driver and database properties are mandatory	    if (driver == null) 		throw new IllegalArgumentException("No driver specified!");	    if (database == null) 		throw new IllegalArgumentException("No database specified!");            // Load the driver.  It registers itself with DriverManager.            Class.forName(driver);            // And set up a connection to the specified database            c = DriverManager.getConnection(database, user, password);                        // Create three new tables for our data            // The package table contains a package id and a package name.            // The class table contains a class id, a package id, and a name.            // The member table contains a class id, a member name, and an bit            // that indicates whether the class member is a field or a method.            Statement s = c.createStatement();            s.executeUpdate("CREATE TABLE package " + 			    "(id INT, name VARCHAR(80))");            s.executeUpdate("CREATE TABLE class " + 			    "(id INT, packageId INT, name VARCHAR(48))");            s.executeUpdate("CREATE TABLE member " + 			    "(classId INT, name VARCHAR(48), isField BIT)");                        // Prepare some statements that will be used to insert records into            // these three tables.            insertpackage =		c.prepareStatement("INSERT INTO package VALUES(?,?)");            insertclass =		c.prepareStatement("INSERT INTO class VALUES(?,?,?)");            insertmember =		c.prepareStatement("INSERT INTO member VALUES(?,?,?)");            // Now loop through the list of classes and use reflection	    // to store them all in the tables	    int numclasses = classnames.size();            for(int i = 0; i < numclasses; i++) {		try {		    storeClass((String)classnames.get(i));		}		catch(ClassNotFoundException e) {		    System.out.println("WARNING: class not found: " +				       classnames.get(i) + "; SKIPPING");		}	    }        }        catch (Exception e) {            System.err.println(e);            if (e instanceof SQLException)                System.err.println("SQLState: " +				   ((SQLException)e).getSQLState());            System.err.println("Usage: java MakeAPIDB " + 			       "<classlistfile> <propfile>");        }        // When we're done, close the connection to the database        finally { try { c.close(); } catch (Exception e) {} }    }    /**      * This hash table records the mapping between package names and package     * id.  This is the only one we need to store temporarily.  The others are     * stored in the db and don't have to be looked up by this program     **/    static Map package_to_id = new HashMap();    // Counters for the package and class identifier columns    static int packageId = 0, classId = 0;        // Some prepared SQL statements for use in inserting    // new values into the tables.  Initialized in main() above.    static PreparedStatement insertpackage, insertclass, insertmember;    /**     * Given a fully-qualified classname, this method stores the package name     * in the package table (if it is not already there), stores the class name     * in the class table, and then uses the Java Reflection API to look up all     * methods and fields of the class, and stores those in the member table.     **/    public static void storeClass(String name) 	throws SQLException, ClassNotFoundException    {        String packagename, classname;	        // Dynamically load the class.        Class c = Class.forName(name);	        // Display output so the user knows that the program is progressing        System.out.println("Storing data for: " + name);	        // Figure out the packagename and the classname        int pos = name.lastIndexOf('.');        if (pos == -1) {            packagename = "";            classname = name;        }        else {            packagename = name.substring(0,pos);            classname = name.substring(pos+1);        }	        // Figure out what the package id is.  If there is one, then this        // package has already been stored in the database.  Otherwise, assign        // an id, and store it and the packagename in the db.        Integer pid;        pid = (Integer)package_to_id.get(packagename);  // Check hashtable        if (pid == null) {            pid = new Integer(++packageId);          // Assign an id            package_to_id.put(packagename, pid);     // Remember it            insertpackage.setInt(1, packageId);      // Set statement args            insertpackage.setString(2, packagename);              insertpackage.executeUpdate();           // Insert into package db        }        // Now, store the classname in the class table of the database.        // This record includes the package id, so that the class is linked to         // the package that contains it.  To store the class, we set arguments        // to the PreparedStatement, then execute that statement        insertclass.setInt(1, ++classId);       // Set class identifier        insertclass.setInt(2, pid.intValue());  // Set package identifier        insertclass.setString(3, classname);    // Set class name        insertclass.executeUpdate();            // Insert the class record        // Now, get a list of all non-private methods of the class, and        // insert those into the "members" table of the database.  Each        // record includes the class id of the containing class, and also        // a value that indicates that these are methods, not fields.        Method[] methods = c.getDeclaredMethods();   // Get a list of methods        for(int i = 0; i < methods.length; i++) {    // For all non-private            if (Modifier.isPrivate(methods[i].getModifiers())) continue;            insertmember.setInt(1, classId);         // Set the class id            insertmember.setString(2, methods[i].getName()); // Set method name            insertmember.setBoolean(3, false);       // It is not a field            insertmember.executeUpdate();            // Insert into db        }        // Do the same thing for the non-private fields of the class        Field[] fields = c.getDeclaredFields();    // Get a list of fields        for(int i = 0; i < fields.length; i++) {   // For each non-private            if (Modifier.isPrivate(fields[i].getModifiers())) continue;            insertmember.setInt(1, classId);       // Set the class id            insertmember.setString(2, fields[i].getName()); // Set field name            insertmember.setBoolean(3, true);      // It is a field            insertmember.executeUpdate();          // Insert the record        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区二区免费不卡 | 色综合中文字幕| 国产一区二区中文字幕| 亚洲一区二三区| 亚洲欧美成aⅴ人在线观看| 国产精品丝袜91| 欧美激情在线看| 国产精品久久久一区麻豆最新章节| 国产三级精品三级| 亚洲mv在线观看| 亚洲一区二区在线播放相泽| 亚洲第一福利视频在线| 天堂va蜜桃一区二区三区| 日韩av电影免费观看高清完整版 | 欧美精品久久99久久在免费线 | 激情综合色综合久久| 韩国v欧美v日本v亚洲v| 国产成人av一区二区三区在线观看| 韩国v欧美v日本v亚洲v| av中文字幕不卡| 色一区在线观看| 91麻豆精品国产91久久久更新时间| 欧美日韩视频不卡| 久久婷婷一区二区三区| 久久久久久久久一| 亚洲欧美综合网| 丝袜国产日韩另类美女| 国产精品一区二区久久不卡| 99re8在线精品视频免费播放| 日本高清不卡视频| 日韩三级免费观看| 国产精品免费视频观看| 日本亚洲三级在线| 国产精品羞羞答答xxdd| 欧美日韩成人一区二区| 久久综合狠狠综合| 亚洲国产精品自拍| 国产成人综合精品三级| 欧美色综合网站| 国产午夜精品久久| 日本欧美在线看| 99re亚洲国产精品| 久久精品视频在线看| 亚洲成年人影院| 欧美一区二区三区的| 亚洲啪啪综合av一区二区三区| 看电影不卡的网站| 欧美酷刑日本凌虐凌虐| 中日韩免费视频中文字幕| 日本欧美在线观看| 欧美亚洲国产一区二区三区| 国产天堂亚洲国产碰碰| 蜜桃免费网站一区二区三区 | 日本伊人色综合网| 在线视频亚洲一区| 久久久精品天堂| 极品尤物av久久免费看| 538在线一区二区精品国产| 亚洲欧美偷拍三级| 成人精品一区二区三区四区 | 一区二区三区精品久久久| 国产成人精品免费视频网站| 日韩精品一区二区三区视频在线观看| 国产自产高清不卡| 日韩欧美国产一区二区三区 | www.亚洲激情.com| 亚洲国产精品ⅴa在线观看| 国产揄拍国内精品对白| 日韩视频中午一区| 免费精品99久久国产综合精品| 欧美精品一二三区| 日本色综合中文字幕| 日韩一区二区三区四区五区六区| 性欧美大战久久久久久久久| 欧美三级中文字幕| 亚洲第一成人在线| 欧美一级夜夜爽| 日本欧美韩国一区三区| 日韩午夜激情视频| 九色|91porny| 久久久久99精品一区| 国产91精品久久久久久久网曝门| 中文字幕欧美国产| 91首页免费视频| 亚洲成人av在线电影| 日韩一区二区在线观看视频| 久久99精品国产麻豆婷婷| 精品国产99国产精品| 国产真实精品久久二三区| 久久精品亚洲一区二区三区浴池| 懂色av一区二区夜夜嗨| 亚洲私人影院在线观看| 欧美色视频一区| 韩国三级在线一区| 国产精品乱子久久久久| 色欧美88888久久久久久影院| 亚洲一卡二卡三卡四卡五卡| 欧美一区二区三区视频免费播放 | 精品久久一区二区三区| 国产偷国产偷精品高清尤物 | 欧美va亚洲va| 成人精品视频.| 亚洲最大成人网4388xx| 日韩精品一区二区三区四区| 国产精选一区二区三区| 亚洲精品乱码久久久久久久久 | 欧美国产一区二区| 日本高清不卡aⅴ免费网站| 免费成人在线网站| 中文字幕一区二区在线观看| 欧美日韩美女一区二区| 国产激情一区二区三区桃花岛亚洲| 中文字幕亚洲成人| 日韩欧美黄色影院| 91视频一区二区| 国产精品亚洲一区二区三区妖精| av日韩在线网站| 亚洲老妇xxxxxx| 2022国产精品视频| 欧美亚洲国产bt| 99久久精品久久久久久清纯| 日韩精品三区四区| 亚洲视频中文字幕| 久久免费美女视频| 日韩一区二区三区电影| 91麻豆国产精品久久| 国产精品一区二区黑丝| 日本午夜一本久久久综合| 一区二区三国产精华液| 欧美国产丝袜视频| 国产亚洲一区二区三区| 欧美精品黑人性xxxx| 欧美性受xxxx黑人xyx性爽| 国产成人精品在线看| 久久精品国产精品青草| 五月激情综合色| 国产精品日韩精品欧美在线| 欧美三级电影在线观看| 91丝袜高跟美女视频| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 另类小说视频一区二区| 亚洲永久精品国产| 亚洲激情av在线| 亚洲乱码中文字幕| 亚洲男同性恋视频| 亚洲激情一二三区| 一区二区三区欧美久久| 亚洲欧美日韩电影| 亚洲特黄一级片| 夜夜精品浪潮av一区二区三区| 亚洲人妖av一区二区| 综合电影一区二区三区 | 亚洲精品在线观| 欧美精品一区二区在线播放| 精品理论电影在线观看 | 美国欧美日韩国产在线播放| 亚洲天堂网中文字| 亚洲免费观看高清完整版在线| 日本一区二区视频在线观看| 中文字幕一区av| 亚洲日本va午夜在线影院| 一区二区三区四区在线免费观看 | 在线观看日韩高清av| 91国偷自产一区二区三区观看| 在线观看亚洲精品视频| 欧美日韩国产高清一区二区| 4438x成人网最大色成网站| 日韩精品中文字幕一区二区三区| 欧美成人性战久久| 久久久精品人体av艺术| 中文字幕制服丝袜一区二区三区| 亚洲毛片av在线| 午夜精品久久久久久久| 久热成人在线视频| 欧美一区二区三区色| 欧美电影一区二区三区| 精品久久国产老人久久综合| 久久精品欧美一区二区三区不卡| 国产精品久久三| 亚洲图片欧美综合| 国模大尺度一区二区三区| 99久久伊人精品| 7777精品伊人久久久大香线蕉经典版下载 | 美腿丝袜在线亚洲一区| 国产成人99久久亚洲综合精品| 91蜜桃视频在线| 精品美女一区二区三区| 自拍偷拍欧美精品| 另类人妖一区二区av| 91在线国产福利| 精品久久久久久亚洲综合网 | 亚洲人亚洲人成电影网站色| 日韩av一级电影| 成人av动漫在线| 精品国产伦一区二区三区观看体验| 亚洲人成亚洲人成在线观看图片 | jiyouzz国产精品久久| 欧美一级爆毛片| 亚洲综合免费观看高清完整版在线| 国内精品自线一区二区三区视频|