* Test pooled connetion for chinese database name, user and password.
* @throws SQLException
*/
public void testCPDSConnect() throws SQLException {
// Test chinese database name.
ConnectionPoolDataSource ds = J2EEDataSource.getConnectionPoolDataSource();
J2EEDataSource.setBeanProperty(ds, "databaseName", "\u4e10");
J2EEDataSource.setBeanProperty(ds, "createDatabase", "create");
try {
PooledConnection poolConn = ds.getPooledConnection();
Connection conn = poolConn.getConnection();
conn.close();
} catch (SQLException se ) {
if (usingEmbedded())
throw se;
else
assertSQLState("22005",se);
}
// Chinese user
try {
J2EEDataSource.setBeanProperty(ds, "user", "\u4e10");
PooledConnection poolConn = ds.getPooledConnection();
Connection conn = poolConn.getConnection();
conn.close();
} catch (SQLException se ) {
if (usingEmbedded())
throw se;
else
assertSQLState("22005",se);
}
// Chinese password
try {
J2EEDataSource.setBeanProperty(ds, "password", "\u4e10");
PooledConnection poolConn= ds.getPooledConnection();
Connection conn = poolConn.getConnection();
conn.close();
} catch (SQLException se ) {
if (usingEmbedded())
throw se;