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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? makeapidb.java

?? java源代碼非常好
?? 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        }    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆成人久久精品二区三区红 | 免费成人深夜小野草| 色噜噜偷拍精品综合在线| 亚洲色图欧洲色图婷婷| 91丝袜美女网| 亚洲成av人在线观看| 在线观看91精品国产麻豆| 美女视频第一区二区三区免费观看网站 | 夜夜精品视频一区二区| 在线日韩国产精品| 日本aⅴ亚洲精品中文乱码| 欧美精品777| 国产一区二区伦理| 中文字幕二三区不卡| 色综合天天综合在线视频| 亚洲观看高清完整版在线观看| 欧美日本韩国一区| 国产一区二区在线视频| 国产精品美女久久久久久久| 91久久久免费一区二区| 青青青伊人色综合久久| 久久免费美女视频| 一本久道中文字幕精品亚洲嫩| 亚洲第一电影网| 精品国产乱码久久久久久夜甘婷婷| 国产美女精品人人做人人爽 | 99re6这里只有精品视频在线观看| 亚洲狼人国产精品| 日韩精品中文字幕在线不卡尤物| 国产一二三精品| 亚洲一区二区视频在线| 久久久久国产精品麻豆ai换脸| 色香色香欲天天天影视综合网| 麻豆传媒一区二区三区| 亚洲精品写真福利| 精品久久久久久久久久久院品网| 99久久亚洲一区二区三区青草| 日韩国产欧美在线视频| 中文字幕一区二区三| 日韩欧美资源站| 色综合久久久网| 国产一区二区视频在线播放| 一区二区三区欧美| 国产精品亲子伦对白| 欧美一区三区二区| 日本黄色一区二区| 国产成人精品aa毛片| 青青草国产精品97视觉盛宴| 亚洲日本青草视频在线怡红院| 久久亚洲精精品中文字幕早川悠里| 99国产精品久久久久久久久久| 精品综合免费视频观看| 亚洲一级二级三级在线免费观看| 中文字幕精品三区| 久久在线免费观看| 日韩欧美中文字幕制服| 欧美欧美欧美欧美| 色狠狠色狠狠综合| 91在线一区二区| 成人激情小说网站| 国产91露脸合集magnet| 美女视频黄免费的久久 | 2024国产精品视频| 欧美日本一区二区在线观看| 一本一道久久a久久精品综合蜜臀| 国产精品18久久久久久久久久久久| 午夜精品久久久久久久99樱桃 | 色狠狠桃花综合| 91在线码无精品| 成人国产亚洲欧美成人综合网| 国产精品中文字幕一区二区三区| 老司机一区二区| 日本人妖一区二区| 日韩一区精品视频| 丝瓜av网站精品一区二区| 亚洲成人动漫在线免费观看| 亚洲va国产天堂va久久en| 亚洲欧美电影院| 亚洲精品国产无套在线观| 国产精品成人在线观看| 中文字幕欧美一| 亚洲欧美日韩一区二区三区在线观看| 国产精品久久久久久久久图文区| 国产精品三级视频| 中文字幕一区二区三区色视频| 中文字幕精品在线不卡| 综合欧美亚洲日本| 亚洲国产一区二区三区| 天天色天天操综合| 精品亚洲porn| 国产一区二区三区视频在线播放| 国产风韵犹存在线视精品| 成人av网站免费观看| 91视频免费播放| 欧美日韩高清一区| 日韩免费观看2025年上映的电影| 精品乱人伦小说| 国产精品麻豆一区二区| 一区二区高清在线| 日本免费在线视频不卡一不卡二| 久久99久久精品| 国产成人在线视频网站| 一本到不卡精品视频在线观看| 欧美美女喷水视频| 91精品国产福利| 久久精品视频免费| 一区二区三区欧美日| 麻豆成人在线观看| 91在线观看视频| 欧美日韩一级二级| 久久亚洲一级片| 亚洲黄色性网站| 九九精品一区二区| 在线亚洲一区观看| 26uuu欧美| 亚洲免费电影在线| 久久国产精品一区二区| 9i在线看片成人免费| 欧美一级理论性理论a| 国产精品久久午夜夜伦鲁鲁| 亚洲综合色视频| 国产一区二区h| 欧美日韩视频在线观看一区二区三区 | 国产偷国产偷精品高清尤物 | 欧美国产一区视频在线观看| 亚洲综合视频网| 国产精品综合网| 欧美久久久久久久久| 国产精品麻豆一区二区| 日韩精彩视频在线观看| av午夜精品一区二区三区| 欧美一级日韩一级| 亚洲精品水蜜桃| 国产精品123区| 7777精品伊人久久久大香线蕉的| 国产精品女主播av| 久久99日本精品| 欧美精品在线观看一区二区| 国产精品嫩草久久久久| 蜜桃久久av一区| 欧美三级电影一区| 亚洲色图视频免费播放| 国产91精品一区二区麻豆网站| 制服视频三区第一页精品| 亚洲视频小说图片| 国产91丝袜在线18| 久久午夜老司机| 美洲天堂一区二卡三卡四卡视频| 欧美亚洲愉拍一区二区| 综合久久久久久| 波多野结衣精品在线| 久久奇米777| 精品亚洲免费视频| 日韩欧美中文一区| 天天色图综合网| 在线观看91av| 天涯成人国产亚洲精品一区av| 一本大道久久a久久精二百| 国产精品私人影院| 成人动漫一区二区三区| 久久久国际精品| 国产精品白丝jk白祙喷水网站| 欧美v日韩v国产v| 久久电影网站中文字幕| 日韩午夜精品电影| 久久国产精品露脸对白| 日韩精品中午字幕| 激情五月婷婷综合网| 2024国产精品| 大美女一区二区三区| 国产精品午夜春色av| 播五月开心婷婷综合| 中文字幕亚洲一区二区va在线| 成人妖精视频yjsp地址| 国产精品欧美一区二区三区| 成人黄色在线网站| 亚洲欧美日韩国产成人精品影院 | 欧美在线看片a免费观看| 亚洲美女视频在线观看| 欧亚洲嫩模精品一区三区| 亚洲午夜av在线| 日韩一区二区三区观看| 国产综合色视频| 国产精品视频麻豆| 在线观看亚洲精品视频| 午夜影视日本亚洲欧洲精品| 91精品国产aⅴ一区二区| 毛片不卡一区二区| 国产人久久人人人人爽| 91小视频免费看| 午夜精品视频一区| 亚洲精品在线网站| www.亚洲免费av| 综合久久给合久久狠狠狠97色| 欧美亚洲愉拍一区二区| 激情综合网av| 亚洲欧美日韩国产另类专区| 在线综合亚洲欧美在线视频| 久久99久久久久久久久久久| 国产精品拍天天在线|