Example usage for java.sql Connection setClientInfo

List of usage examples for java.sql Connection setClientInfo

Introduction

In this page you can find the example usage for java.sql Connection setClientInfo.

Prototype

void setClientInfo(Properties properties) throws SQLClientInfoException;

Source Link

Document

Sets the value of the connection's client info properties.

Usage

From source file:com.adaptris.jdbc.connection.FailoverDatasourceTest.java

@Test
public void testClientInfo() throws Exception {
    Connection conn = new MyProxy();

    try {/*  w  w  w . j a  va  2 s  .com*/
        try {
            conn.setClientInfo(conn.getClientInfo());
        } catch (SQLException e) {

        }
        try {
            conn.setClientInfo("hello", "world");
            conn.getClientInfo("hello");
        } catch (SQLException e) {

        }
    } finally {
        JdbcUtil.closeQuietly(conn);
    }

    conn = new FailingProxy();
    try {
        try {
            conn.setClientInfo(conn.getClientInfo());
        } catch (SQLException e) {

        }
        try {
            conn.setClientInfo("hello", "world");
            conn.getClientInfo("hello");
        } catch (SQLException e) {

        }
    } finally {
        JdbcUtil.closeQuietly(conn);
    }
}