當前位置: 首頁>>代碼示例>>Java>>正文


Java SQLClientInfoException.initCause方法代碼示例

本文整理匯總了Java中java.sql.SQLClientInfoException.initCause方法的典型用法代碼示例。如果您正苦於以下問題:Java SQLClientInfoException.initCause方法的具體用法?Java SQLClientInfoException.initCause怎麽用?Java SQLClientInfoException.initCause使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.sql.SQLClientInfoException的用法示例。


在下文中一共展示了SQLClientInfoException.initCause方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setClientInfo

import java.sql.SQLClientInfoException; //導入方法依賴的package包/類
public void setClientInfo(Properties properties) throws SQLClientInfoException {
    try {
        getClientInfoProviderImpl().setClientInfo(this, properties);
    } catch (SQLClientInfoException ciEx) {
        throw ciEx;
    } catch (SQLException sqlEx) {
        SQLClientInfoException clientInfoEx = new SQLClientInfoException();
        clientInfoEx.initCause(sqlEx);

        throw clientInfoEx;
    }
}
 
開發者ID:rafallis,項目名稱:BibliotecaPS,代碼行數:13,代碼來源:JDBC4Connection.java

示例2: setClientInfo

import java.sql.SQLClientInfoException; //導入方法依賴的package包/類
public void setClientInfo(Properties properties) throws SQLClientInfoException {
    try {
        checkClosed();

        ((java.sql.Connection) this.mc).setClientInfo(properties);
    } catch (SQLException sqlException) {
        try {
            checkAndFireConnectionError(sqlException);
        } catch (SQLException sqlEx2) {
            SQLClientInfoException clientEx = new SQLClientInfoException();
            clientEx.initCause(sqlEx2);

            throw clientEx;
        }
    }
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:17,代碼來源:JDBC4ConnectionWrapper.java

示例3: setClientInfo

import java.sql.SQLClientInfoException; //導入方法依賴的package包/類
public synchronized void setClientInfo(java.sql.Connection conn, Properties properties) throws SQLClientInfoException {
    try {
        Enumeration<?> propNames = properties.propertyNames();

        while (propNames.hasMoreElements()) {
            String name = (String) propNames.nextElement();
            String value = properties.getProperty(name);

            setClientInfo(conn, name, value);
        }
    } catch (SQLException sqlEx) {
        SQLClientInfoException clientInfoEx = new SQLClientInfoException();
        clientInfoEx.initCause(sqlEx);

        throw clientInfoEx;
    }
}
 
開發者ID:Jugendhackt,項目名稱:OpenVertretung,代碼行數:18,代碼來源:JDBC4ClientInfoProviderSP.java

示例4: setClientInfo

import java.sql.SQLClientInfoException; //導入方法依賴的package包/類
public synchronized void setClientInfo(java.sql.Connection conn, String name, String value) throws SQLClientInfoException {
    try {
        this.setClientInfoSp.setString(1, name);
        this.setClientInfoSp.setString(2, value);
        this.setClientInfoSp.execute();
    } catch (SQLException sqlEx) {
        SQLClientInfoException clientInfoEx = new SQLClientInfoException();
        clientInfoEx.initCause(sqlEx);

        throw clientInfoEx;
    }
}
 
開發者ID:JuanJoseFJ,項目名稱:ProyectoPacientes,代碼行數:13,代碼來源:JDBC4ClientInfoProviderSP.java

示例5: setClientInfo

import java.sql.SQLClientInfoException; //導入方法依賴的package包/類
public void setClientInfo(String name, String value) throws SQLClientInfoException {
    try {
        getClientInfoProviderImpl().setClientInfo(this, name, value);
    } catch (SQLClientInfoException ciEx) {
        throw ciEx;
    } catch (SQLException sqlEx) {
        SQLClientInfoException clientInfoEx = new SQLClientInfoException();
        clientInfoEx.initCause(sqlEx);

        throw clientInfoEx;
    }
}
 
開發者ID:bragex,項目名稱:the-vigilantes,代碼行數:13,代碼來源:JDBC4Connection.java

示例6: setClientInfo

import java.sql.SQLClientInfoException; //導入方法依賴的package包/類
/**
     * Sets the value of the client info property specified by name to the
     * value specified by value.
     * <p>
     * Applications may use the <code>DatabaseMetaData.getClientInfoProperties</code>
     * method to determine the client info properties supported by the driver
     * and the maximum length that may be specified for each property.
     * <p>
     * The driver stores the value specified in a suitable location in the
     * database.  For example in a special register, session parameter, or
     * system table column.  For efficiency the driver may defer setting the
     * value in the database until the next time a statement is executed or
     * prepared.  Other than storing the client information in the appropriate
     * place in the database, these methods shall not alter the behavior of
     * the connection in anyway.  The values supplied to these methods are
     * used for accounting, diagnostics and debugging purposes only.
     * <p>
     * The driver shall generate a warning if the client info name specified
     * is not recognized by the driver.
     * <p>
     * If the value specified to this method is greater than the maximum
     * length for the property the driver may either truncate the value and
     * generate a warning or generate a <code>SQLClientInfoException</code>.  If the driver
     * generates a <code>SQLClientInfoException</code>, the value specified was not set on the
     * connection.
     * <p>
     * The following are standard client info properties.  Drivers are not
     * required to support these properties however if the driver supports a
     * client info property that can be described by one of the standard
     * properties, the standard property name should be used.
     * <p>
     * <ul>
     * <li>ApplicationName      -       The name of the application currently utilizing
     *                                                  the connection</li>
     * <li>ClientUser           -       The name of the user that the application using
     *                                                  the connection is performing work for.  This may
     *                                                  not be the same as the user name that was used
     *                                                  in establishing the connection.</li>
     * <li>ClientHostname       -       The hostname of the computer the application
     *                                                  using the connection is running on.</li>
     * </ul>
     * <p>
     * @param name              The name of the client info property to set
     * @param value             The value to set the client info property to.  If the
     *                                  value is null, the current value of the specified
     *                                  property is cleared.
     * <p>
     * @throws  SQLClientInfoException if the database server returns an error while
     *                  setting the client info value on the database server or this method
     * is called on a closed connection
     * <p>
     * @since JDK 1.6, HSQLDB 1.9.0
     */
//#ifdef JAVA6
    public void setClientInfo(String name,
                              String value) throws SQLClientInfoException {

        try {
            checkClosed();
        } catch (SQLException ex) {
            SQLClientInfoException e =
                new SQLClientInfoException(ex.getMessage(), null);

            e.initCause(ex);

            throw e;
        }

        SQLWarning warning = new SQLWarning("ClientInfo name not recognized: "
            + name);

        warning.initCause(Util.notSupported());
        addWarning(warning);
    }
 
開發者ID:s-store,項目名稱:sstore-soft,代碼行數:75,代碼來源:JDBCConnection.java

示例7: setClientInfo

import java.sql.SQLClientInfoException; //導入方法依賴的package包/類
/**
     * Sets the value of the client info property specified by name to the
     * value specified by value.
     * <p>
     * Applications may use the <code>DatabaseMetaData.getClientInfoProperties</code>
     * method to determine the client info properties supported by the driver
     * and the maximum length that may be specified for each property.
     * <p>
     * The driver stores the value specified in a suitable location in the
     * database.  For example in a special register, session parameter, or
     * system table column.  For efficiency the driver may defer setting the
     * value in the database until the next time a statement is executed or
     * prepared.  Other than storing the client information in the appropriate
     * place in the database, these methods shall not alter the behavior of
     * the connection in anyway.  The values supplied to these methods are
     * used for accounting, diagnostics and debugging purposes only.
     * <p>
     * The driver shall generate a warning if the client info name specified
     * is not recognized by the driver.
     * <p>
     * If the value specified to this method is greater than the maximum
     * length for the property the driver may either truncate the value and
     * generate a warning or generate a <code>SQLClientInfoException</code>.  If the driver
     * generates a <code>SQLClientInfoException</code>, the value specified was not set on the
     * connection.
     * <p>
     * The following are standard client info properties.  Drivers are not
     * required to support these properties however if the driver supports a
     * client info property that can be described by one of the standard
     * properties, the standard property name should be used.
     * <p>
     * <ul>
     * <li>ApplicationName  -       The name of the application currently utilizing
     *                                                  the connection</li>
     * <li>ClientUser           -       The name of the user that the application using
     *                                                  the connection is performing work for.  This may
     *                                                  not be the same as the user name that was used
     *                                                  in establishing the connection.</li>
     * <li>ClientHostname   -       The host name of the computer the application
     *                                                  using the connection is running on.</li>
     * </ul>
     * <p>
     * <!-- start release-specific documentation -->
     * <div class="ReleaseSpecificDocumentation">
     * <h3>HSQLDB-Specific Information:</h3> <p>
     *
     * HSQLDB 2.0, throws an SQLClientInfoException when this method is
     * called.
     * </div>
     * <!-- end release-specific documentation -->
     *
     * @param name          The name of the client info property to set
     * @param value         The value to set the client info property to.  If the
     *                                      value is null, the current value of the specified
     *                                      property is cleared.
     * <p>
     * @throws      SQLClientInfoException if the database server returns an error while
     *                      setting the client info value on the database server or this method
     * is called on a closed connection
     * <p>
     * @since JDK 1.6, HSQLDB 2.0
     */
//#ifdef JAVA6
    public void setClientInfo(String name,
                              String value) throws SQLClientInfoException {

        SQLClientInfoException ex = new SQLClientInfoException();

        ex.initCause(JDBCUtil.notSupported());

        throw ex;
    }
 
開發者ID:tiweGH,項目名稱:OpenDiabetes,代碼行數:73,代碼來源:JDBCConnection.java


注:本文中的java.sql.SQLClientInfoException.initCause方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。