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

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

?? dbservices.java

?? 利用java反射機制
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package org.julp;import javax.naming.*;import javax.sql.*;import java.sql.*;import java.util.List;import java.util.Properties;/** * * @author  leonard */public class DBServices extends Object implements java.io.Serializable, Cloneable {        protected transient Context context;    protected transient DataSource dataSource;    protected transient Connection connection;    protected boolean connectionClosed = false;    protected PreparedStatement preparedStatement;    protected transient ResultSet resultSet;    protected Statement statement;    protected boolean useDataSource = true;    protected String dataSourceName = null;    protected Properties connectionProperties = null;        protected boolean escapeProcessing = true;    protected int maxFieldSize = 0;    protected int maxRows = 0;    protected int queryTimeout = 0;    protected int fetchDirection = 0;    protected int fetchSize = 0;    //TYPE_FORWARD_ONLY = 1003, TYPE_SCROLL_INSENSITIVE = 1004, TYPE_SCROLL_SENSITIVE = 1005    protected int resultSetType = ResultSet.TYPE_FORWARD_ONLY;    //CONCUR_READ_ONLY, CONCUR_UPDATABLE    protected int concurrency = ResultSet.CONCUR_READ_ONLY;    protected boolean readOnly = false;    protected boolean closeStatementAfterExecute = true;        /** Holds value of property driverName. */    private String driverName;        /** Holds value of property dbUrl. */    private String dbUrl;        /** Holds value of property userName. */    private String userName;        /** Holds value of property password. */    private String password;        /* How many rows to update/insert/delete in transaction */    protected int maxRowsToProccesInTransaction = 0;    protected int rowsAffectedInTransaction = 0;    protected String connectionId = "";    protected boolean tranInProccess = false;        protected boolean debug = false;            /** Creates new DBServices */    public DBServices() {        if (Boolean.getBoolean("debug-julp") || Boolean.getBoolean("debug-" + getClass().getName())){            debug = true;        }            }        /** Getter for property context.     * @return Value of property context.     *     */    public javax.naming.Context getContext(){        try{            context = new InitialContext();            if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::getContext()::context: " + context + " \n");        }catch (NamingException ne){            throw new RuntimeException(ne);        }        return context;    }        /** Setter for property context.     * @param context New value of property context.     *     */    public void setContext(javax.naming.Context context) {        this.context = context;    }        /** Getter for property connection.     * @return Value of property connection.     *     */    public java.sql.Connection getConnection()  throws SQLException{        if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::getConnection()::connection 1: " + connection + "::isTranInProccess(): " + tranInProccess + " \n");                if (isTranInProccess()){            //if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::getConnection()::isTranInProccess()::connection.toString(): " + connection.toString() + " \n");            return this.connection;        }        //if (connection == null || connection.isClosed()){        if (connection == null || this.isConnectionClosed()){ //Sybase bug workaround            if (isUseDataSource() == true){                dataSource = this.getDataSource();                if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "getConnection()::dataSource 1: " + dataSource + " \n");                connection = dataSource.getConnection();                //connection.rollback();                if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "getConnection()::connection 2: " + connection + " \n");            }else{                try {                    Class.forName(getDriverName());                    if (this.connectionProperties == null || this.connectionProperties.isEmpty()){                        connection = DriverManager.getConnection(getDbUrl(), getUserName(), getPassword());                    }else{                        connection = DriverManager.getConnection(getDbUrl(), this.connectionProperties);                    }                }catch (ClassNotFoundException ex) {                    ex.printStackTrace();                    throw new RuntimeException(ex);                }catch (SQLException sqle) {                    sqle.printStackTrace();                    throw new RuntimeException(sqle);                }catch (Exception e) {                    e.printStackTrace();                    throw new RuntimeException(e);                }            }        }        if (isTranInProccess()){            if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::getConnection()::isTranInProccess(): " + isTranInProccess() + "::connectionId: " + connectionId + "\n");            //if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::connection.toString(): " + connection.toString() + " \n");            //if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::this.connectionId.equals(connection.toString(): " + this.connectionId.equals(connection.toString()) + " \n");            if (!this.connectionId.equals(connection.toString())){                //if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::connectionId: " + connectionId + " \n");                throw new SQLException("Connection was closed while in transaction");            }        }        return connection;    }        /** Setter for property connection.     * @param connection New value of property connection.     *     */    public void setConnection(java.sql.Connection connection) {        this.connection = connection;    }        /** Getter for property dataSource.     * @return Value of property dataSource.     *     */    public javax.sql.DataSource getDataSource() {        try{            dataSource = (DataSource) this.getContext().lookup("java:comp/env/jdbc/" + getDataSourceName());            if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::getDataSource()::dataSource: " + dataSource + " \n");        }catch (NamingException ne){            throw new RuntimeException(ne.getMessage());        }        return dataSource;    }        /** Setter for property dataSource.     * @param dataSource New value of property dataSource.     *     */    public void setDataSource(javax.sql.DataSource dataSource) {        this.dataSource = dataSource;    }        /** Getter for property preparedStatement.     * @return Value of property preparedStatement.     *     */    public java.sql.PreparedStatement getPreparedStatement(String sql, List parms) throws SQLException{        preparedStatement = this.getConnection().prepareStatement(sql, getResultSetType(), getConcurrency());        if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::getPreparedStatement(): " + preparedStatement + "::sql: " + sql + " parms: " + parms + " \n");                preparedStatement.setEscapeProcessing(this.getEscapeProcessing());        preparedStatement.setFetchSize(this.getFetchSize());        preparedStatement.setMaxRows(this.getMaxRows());        preparedStatement.setMaxFieldSize(this.getMaxFieldSize());        preparedStatement.setQueryTimeout(this.getQueryTimeout());        //ParameterMetaData pmd = preparedStatement.getParameterMetaData();        for (int i = 0;i < parms.size();i ++){            int parmIdx = i + 1;            Object param = parms.get(i);            if (param instanceof java.util.Date){                param = new java.sql.Date( ((java.util.Date) param).getTime() );            }            if (param != null){                preparedStatement.setObject(parmIdx, param);            }else{                preparedStatement.setNull(parmIdx, Types.JAVA_OBJECT);                //preparedStatement.setNull(parmIdx, pmd.getParameterType(parmIdx));            }        }        return preparedStatement;    }        /** Setter for property preparedStatement.     * @param preparedStatement New value of property preparedStatement.     *     */    public void setPreparedStatement(java.sql.PreparedStatement preparedStatement) {        this.preparedStatement = preparedStatement;    }        /** Getter for property resultSet.     * @return Value of property resultSet.     *     */    public java.sql.ResultSet getResultSet(String sql) throws SQLException{        resultSet = this.getStatement().executeQuery(sql);        if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::getResultSet()::sql: " + sql + " \n");        return resultSet;    }        public java.sql.ResultSet getResultSet(String sql, List parms) throws SQLException{        resultSet = this.getPreparedStatement(sql, parms).executeQuery();        if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::getResultSet(): " + resultSet + " \n");        return resultSet;    }        public int execute(String sql) throws SQLException{        int rows = -1;        try{            rows = this.getStatement().executeUpdate(sql);        }finally{            if (isCloseStatementAfterExecute()){                if (statement != null){                    statement.close();                    statement = null;                }                            }        }                this.setRowsAffectedInTransaction(rowsAffectedInTransaction + rows);        if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::execute()::sql: " + sql + "::affectedRows: " + rows + "\n");                return rows;    }        public int execute(String sql, List parms) throws SQLException{        int rows = -1;        try{            rows = this.getPreparedStatement(sql, parms).executeUpdate();        }finally{            if (isCloseStatementAfterExecute()){                                if (preparedStatement != null){                    preparedStatement.close();                    preparedStatement = null;                }            }        }        this.setRowsAffectedInTransaction(rowsAffectedInTransaction + rows);        if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::execute()::sql: " + sql + " parms: " + parms + "::affectedRows: " + rows + "\n");                return rows;    }        /** Setter for property resultSet.     * @param resultSet New value of property resultSet.     *     */    public void setResultSet(java.sql.ResultSet resultSet) {        this.resultSet = resultSet;    }        /** Getter for property statement.     * @return Value of property statement.     *     */    public java.sql.Statement getStatement() throws SQLException{        //        statement = this.getConnection().createStatement();        statement = this.getConnection().createStatement(getResultSetType(), getConcurrency());        statement.setEscapeProcessing(this.getEscapeProcessing());        statement.setFetchSize(this.getFetchSize());        statement.setMaxRows(this.getMaxRows());        statement.setMaxFieldSize(this.getMaxFieldSize());        statement.setQueryTimeout(this.getQueryTimeout());        return statement;    }        /** Setter for property statement.     * @param statement New value of property statement.     *     */    public void setStatement(java.sql.Statement statement) {        this.statement = statement;    }        public void release(boolean closeConnection) throws SQLException{        if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::=============== RELEASE ============ closeConnection: " + closeConnection + " \n");        if (resultSet != null){            resultSet.close();            resultSet = null;        }        if (statement != null){            statement.close();            statement = null;        }        if (preparedStatement != null){            preparedStatement.close();            preparedStatement = null;        }        if (connection != null){            if (closeConnection == true){                //connection.rollback();//?? Sybase bug                connection.close();                setConnectionClosed(true);                connection = null;                this.setTranInProccess(false);                                this.setConnectionId("");                            }else{                //do nothing            }        }    }        public void beginTran() throws SQLException{                if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::=============== BEGIN TRAN ============ previous connectionId: " + connectionId + " \n");        this.setRowsAffectedInTransaction(0);        this.getConnection().setAutoCommit(false);        this.setConnectionId(this.connection.toString());        this.setTranInProccess(true);           if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::=============== BEGIN TRAN ============ current connectionId: " + connectionId + " \n");    }        public void commitTran() throws SQLException{        if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::=============== COMMIT TRAN ============= current connectionId: " + connectionId + " \n");        this.getConnection().commit();        if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::=============== COMMITTED ================\n");        //this.getConnection().setAutoCommit(true);//?? Sybase bug        //if (debug) System.out.println("setAutoCommit(true)");        this.setTranInProccess(false);        //if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::=============== COMMIT TRAN ============= after setTranInProccess(false) connectionId: " + connectionId + " \n");        this.setConnectionId("");        //if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::=============== COMMIT TRAN ============= after setConnectionId(\"\") connectionId: " + connectionId + " \n");    }        public void rollbackTran() throws SQLException{        if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::=============== ROLLBACK TRAN ============= connectionId: " + connectionId + " \n");        this.getConnection().rollback();        if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::=============== AFTER ROLLBACK =========== connectionId: " + connectionId + " \n");        this.getConnection().setAutoCommit(true);        this.setTranInProccess(false);        //if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::=============== ROLLBACK TRAN ============= after setTranInProccess(false) connectionId: " + connectionId + " \n");        this.setConnectionId("");        //if (debug) System.out.println("julp ============= " + new java.util.Date() + " " + this.getClass() + "::=============== ROLLBACK TRAN ============= after setConnectionId(\"\") connectionId: " + connectionId + " \n");    }        /** Getter for property useDataSource.     * @return Value of property useDataSource.     *     */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品一区二区国语对白| 国产乱人伦偷精品视频不卡| 中文字幕一区二区视频| 国产精品系列在线| 欧美国产乱子伦| 18欧美亚洲精品| 亚洲欧洲三级电影| 一级日本不卡的影视| 亚洲尤物在线视频观看| 日韩国产高清在线| 老汉av免费一区二区三区| 美腿丝袜亚洲综合| 韩日精品视频一区| 不卡电影一区二区三区| 91极品美女在线| 欧美一区二区免费| 久久久久国产精品人| 中文字幕在线不卡视频| 亚洲综合视频在线观看| 日韩成人av影视| 国产福利一区二区三区| 色综合久久综合网97色综合| 在线视频中文字幕一区二区| 欧美一级艳片视频免费观看| 国产亚洲欧美激情| 亚洲在线中文字幕| 国产呦精品一区二区三区网站| 国产成人免费在线观看| 色婷婷综合五月| 亚洲精品在线网站| 亚洲免费高清视频在线| 激情综合网av| 在线精品国精品国产尤物884a| 日韩欧美的一区二区| 中文字幕在线不卡| 精品一区二区三区在线播放视频 | 日韩欧美一区二区三区在线| 久久精品亚洲一区二区三区浴池| 国产精品夫妻自拍| 免费观看成人av| 91老师国产黑色丝袜在线| 日韩一二三区不卡| 亚洲综合网站在线观看| 国产成人综合网| 欧美美女一区二区在线观看| 国产女人水真多18毛片18精品视频 | 欧美va在线播放| 一区二区三区自拍| 国产综合色产在线精品| 欧美人妖巨大在线| 一级女性全黄久久生活片免费| 国产伦精品一区二区三区免费迷| 欧美三级在线看| 亚洲精品ww久久久久久p站| 国产精品综合在线视频| 欧美一区二区三区影视| 一区二区三区 在线观看视频| 丁香啪啪综合成人亚洲小说 | 国产九九视频一区二区三区| 欧美狂野另类xxxxoooo| 一区二区在线观看视频| 91在线视频官网| 国产精品视频一二三区 | 亚洲日本韩国一区| 国产风韵犹存在线视精品| 欧美电视剧在线观看完整版| 日韩在线一区二区三区| 91精品在线麻豆| 亚洲成人一区二区在线观看| 在线日韩av片| 亚洲高清不卡在线| 欧美日韩国产不卡| 亚洲成人tv网| 91麻豆精品国产自产在线观看一区| 亚洲精品少妇30p| 欧美网站一区二区| 亚洲一区二区三区中文字幕| 欧美少妇bbb| 免播放器亚洲一区| 日韩欧美专区在线| 国产呦萝稀缺另类资源| 日本一区二区高清| 色综合久久66| 亚洲成人一区在线| 日韩一区二区中文字幕| 国产一区 二区| 国产亚洲精久久久久久| 91视频观看视频| 亚洲大型综合色站| 欧美久久久久久久久| 久久国产乱子精品免费女| 久久综合色鬼综合色| 成人午夜在线播放| 亚洲成人免费电影| 欧美精品一区二区三区在线播放| 国产精品一级黄| 亚洲精品成人a在线观看| 欧美一区二区三区不卡| 国产成人综合在线| 亚洲风情在线资源站| 精品少妇一区二区三区免费观看 | 精品人伦一区二区色婷婷| 国产盗摄一区二区| 亚洲国产精品人人做人人爽| 日韩免费视频一区| 99精品热视频| 蜜桃av一区二区三区电影| 国产精品久久久久婷婷| 欧美精品在线视频| 成人激情综合网站| 蜜芽一区二区三区| 亚洲精品免费播放| 国产午夜亚洲精品理论片色戒| 91论坛在线播放| 国产乱人伦偷精品视频免下载| 亚洲另类春色校园小说| 久久免费美女视频| 91精品国产91久久综合桃花| 成人免费黄色大片| 麻豆精品在线视频| 亚洲高清一区二区三区| 国产精品全国免费观看高清 | 日韩国产在线一| 成人免费三级在线| 国产成人综合精品三级| 欧美videossexotv100| 色综合亚洲欧洲| 国产精品资源网站| 天天色图综合网| 亚洲欧美日韩国产中文在线| 久久夜色精品国产欧美乱极品| 在线视频你懂得一区| 国产精品资源在线看| 麻豆精品在线观看| 亚洲福利电影网| 一区二区三区日韩精品视频| 国产欧美综合色| 欧美精品一区二区在线播放| 69堂精品视频| 69堂国产成人免费视频| 欧美亚洲国产一区二区三区va| 国产iv一区二区三区| 国内精品久久久久影院一蜜桃| 午夜国产不卡在线观看视频| 亚洲制服丝袜在线| 亚洲婷婷综合色高清在线| 国产精品沙发午睡系列990531| 欧美xxxx老人做受| 2欧美一区二区三区在线观看视频| 欧美日本在线看| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 成人午夜电影小说| 豆国产96在线|亚洲| 国产精品 欧美精品| 成人午夜视频免费看| 成人av资源在线观看| 91丨porny丨首页| 一本色道a无线码一区v| 在线观看www91| 制服.丝袜.亚洲.另类.中文| 欧美日韩国产综合一区二区| 欧美日韩卡一卡二| 日韩亚洲欧美在线观看| 亚洲精品在线观看网站| 久久久亚洲精品石原莉奈| 国产日本欧美一区二区| 中文字幕不卡在线| 亚洲色图在线播放| 亚洲国产精品久久一线不卡| 午夜精品一区二区三区电影天堂 | 777xxx欧美| 久久先锋影音av| 中文字幕一区二区三区蜜月| 中文字幕一区二区三区乱码在线 | 日韩亚洲欧美中文三级| 久久影音资源网| 中文字幕五月欧美| 亚洲高清免费视频| 国内国产精品久久| 91麻豆免费看片| 337p亚洲精品色噜噜噜| 国产精品网站导航| 日精品一区二区三区| 国产传媒久久文化传媒| 欧美影院午夜播放| 欧美精品一区二区蜜臀亚洲| 亚洲人成网站影音先锋播放| 日韩电影在线观看网站| 成人午夜视频免费看| 69精品人人人人| 亚洲天堂av一区| 国产在线看一区| 欧美日韩在线播放三区四区| 亚洲精品一线二线三线无人区| 中文字幕一区二区三区精华液 | 亚洲一区二区三区自拍| 国产精品一卡二| 日韩一卡二卡三卡四卡| 国产精品污污网站在线观看| 亚洲.国产.中文慕字在线|