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

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

?? makeapidb.java

?? 164個簡單的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        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人在线色| 欧美高清激情brazzers| 欧美日韩在线播放一区| 精品国产一区二区在线观看| 尤物视频一区二区| 国产美女在线精品| 日韩一区二区麻豆国产| 综合激情成人伊人| 国产原创一区二区| 91精品中文字幕一区二区三区| 精品毛片乱码1区2区3区| 亚洲一级二级三级| caoporen国产精品视频| 久久先锋资源网| 亚洲不卡一区二区三区| 91视视频在线观看入口直接观看www| 欧美一级二级三级蜜桃| 亚洲成人在线免费| 欧洲精品中文字幕| 综合亚洲深深色噜噜狠狠网站| 国产高清精品网站| 久久先锋影音av鲁色资源网| 春色校园综合激情亚洲| 欧美一级片在线看| 午夜一区二区三区视频| 欧美在线综合视频| 亚洲区小说区图片区qvod| 成人免费视频一区| 亚洲国产精品国自产拍av| 国产美女精品人人做人人爽| 日韩午夜中文字幕| 奇米精品一区二区三区四区| 欧美一级久久久| 久久精品国产亚洲高清剧情介绍| 欧美一区二区视频在线观看2022| 日本欧美加勒比视频| 337p亚洲精品色噜噜| 免费看精品久久片| 欧美电影免费观看高清完整版在| 久久精品久久精品| 久久久久亚洲综合| 国产亚洲短视频| 国产欧美日韩三区| 天天操天天综合网| 91精品国产91久久久久久最新毛片| 亚洲午夜在线视频| 欧美日韩成人综合在线一区二区| 天天操天天干天天综合网| 3d成人h动漫网站入口| 日韩av午夜在线观看| 2020国产精品久久精品美国| 成人一区二区在线观看| 亚洲色图在线视频| 欧美人牲a欧美精品| 韩国欧美国产1区| 亚洲欧美怡红院| 欧美日韩国产123区| 国模一区二区三区白浆| 中文字幕一区二区三区四区| 欧美日韩激情在线| 精品综合久久久久久8888| 中文字幕成人在线观看| 欧美色成人综合| 精品一区二区在线视频| 日韩一区日韩二区| 日韩午夜在线观看| 在线视频观看一区| 亚洲成av人片在www色猫咪| 精品国产乱码久久久久久蜜臀 | 久久久久久久久久久久久久久99| 国产激情一区二区三区四区| 国产精品久久久久桃色tv| 7777精品伊人久久久大香线蕉经典版下载 | 亚洲九九爱视频| 日韩一区二区中文字幕| www.日韩大片| 热久久一区二区| 亚洲欧美一区二区在线观看| 日韩精品自拍偷拍| 欧美亚洲图片小说| 国产成人福利片| 偷拍与自拍一区| 中文字幕一区二区三区在线播放| 欧美一区二区视频免费观看| 91美女片黄在线| 国内精品久久久久影院薰衣草 | 国产一二三精品| 亚欧色一区w666天堂| 中文字幕欧美激情一区| 国产精品国产三级国产普通话三级| 在线免费不卡视频| 成人深夜福利app| 国产在线播放一区三区四| 亚洲午夜在线电影| 一区二区三区丝袜| 国产精品久线在线观看| 久久久精品2019中文字幕之3| 欧美午夜精品一区二区三区| 99re在线视频这里只有精品| 国产成人在线视频网站| 国产一区二区三区av电影| 美女一区二区久久| 视频一区在线视频| 午夜伊人狠狠久久| 一区二区三区欧美日| 中文字幕在线观看不卡| 国产精品欧美极品| 亚洲国产精品成人久久综合一区| 久久综合久久综合久久| 日韩美女天天操| 欧美一卡二卡在线| 宅男噜噜噜66一区二区66| 欧美日韩国产一级| 欧美精品成人一区二区三区四区| 91久久一区二区| 色噜噜狠狠色综合欧洲selulu| 99久久99久久免费精品蜜臀| 大桥未久av一区二区三区中文| 国产69精品久久久久毛片| 国产成人精品免费网站| 国产永久精品大片wwwapp| 国产美女视频一区| 成人在线综合网站| 99久久综合狠狠综合久久| 95精品视频在线| 欧美自拍丝袜亚洲| 5566中文字幕一区二区电影| 在线播放91灌醉迷j高跟美女| 欧美日本乱大交xxxxx| 欧美一区二区国产| 久久综合久久综合久久综合| 欧美—级在线免费片| 亚洲日本一区二区| 亚洲第四色夜色| 久久99国产精品久久99果冻传媒| 国产乱码精品1区2区3区| 国产白丝精品91爽爽久久| 97久久精品人人爽人人爽蜜臀| 日本精品一区二区三区高清| 欧美日韩精品一区二区天天拍小说| 欧美日韩国产综合草草| 久久人人97超碰com| 欧美极品另类videosde| 亚洲午夜精品在线| 久久99精品一区二区三区| 波多野结衣亚洲一区| 欧美日韩在线观看一区二区 | 欧美性猛交xxxx乱大交退制版| 51精品国自产在线| 国产欧美日韩综合| 亚洲va天堂va国产va久| 国内精品伊人久久久久av一坑| 99国产精品一区| 欧美成人女星排名| 亚洲视频中文字幕| 美女一区二区视频| 一本色道亚洲精品aⅴ| 欧美大片免费久久精品三p| 国产精品久久毛片a| 美女久久久精品| av在线综合网| 精品国产人成亚洲区| 一区二区三区四区在线免费观看| 久久se这里有精品| 在线精品国精品国产尤物884a| 亚洲精品一区二区三区99| 亚洲一区二区精品视频| 成人av在线资源网站| 精品国产一区二区三区久久影院| 亚洲色图丝袜美腿| 国产在线播精品第三| 欧美色综合影院| 亚洲欧洲成人自拍| 国产精品一区二区在线播放| 欧美日韩中文字幕精品| 自拍偷在线精品自拍偷无码专区| 精品在线观看视频| 欧美日韩高清在线| 一区二区三区四区亚洲| 99久久精品免费看| 久久久无码精品亚洲日韩按摩| 视频一区在线视频| 欧美日韩国产123区| 一区二区在线免费观看| 91丝袜美女网| 国产精品激情偷乱一区二区∴| 国产伦精一区二区三区| 欧美不卡一区二区| 免费视频一区二区| 欧美老人xxxx18| 亚洲一二三四在线| 在线精品视频一区二区三四| 伊人婷婷欧美激情| 色菇凉天天综合网| 亚洲欧美日韩精品久久久久| a美女胸又www黄视频久久| 国产精品女人毛片| www.色综合.com| 亚洲欧美另类在线| 色综合婷婷久久|