Search in sources :

Example 21 with PropertyVetoException

use of java.beans.PropertyVetoException in project j2objc by google.

the class PropertyVetoExceptionTest method testPropertyVetoException_EventNull.

public void testPropertyVetoException_EventNull() {
    String message = "testPropertyVetoException";
    PropertyVetoException e = new PropertyVetoException(message, null);
    assertSame(message, e.getMessage());
    assertNull(e.getPropertyChangeEvent());
}
Also used : PropertyVetoException(java.beans.PropertyVetoException)

Example 22 with PropertyVetoException

use of java.beans.PropertyVetoException in project j2objc by google.

the class PropertyVetoExceptionTest method testPropertyVetoException.

public void testPropertyVetoException() {
    String message = "testPropertyVetoException";
    PropertyVetoException e = new PropertyVetoException(message, event);
    assertSame(message, e.getMessage());
    assertSame(event, e.getPropertyChangeEvent());
}
Also used : PropertyVetoException(java.beans.PropertyVetoException)

Example 23 with PropertyVetoException

use of java.beans.PropertyVetoException in project j2objc by google.

the class PropertyVetoExceptionTest method testPropertyVetoException_MessageNull.

public void testPropertyVetoException_MessageNull() {
    String message = null;
    PropertyVetoException e = new PropertyVetoException(message, event);
    assertNull(e.getMessage());
    assertSame(event, e.getPropertyChangeEvent());
}
Also used : PropertyVetoException(java.beans.PropertyVetoException)

Example 24 with PropertyVetoException

use of java.beans.PropertyVetoException in project jfinal by jfinal.

the class C3p0Plugin method start.

public boolean start() {
    if (isStarted)
        return true;
    dataSource = new ComboPooledDataSource();
    dataSource.setJdbcUrl(jdbcUrl);
    dataSource.setUser(user);
    dataSource.setPassword(password);
    try {
        dataSource.setDriverClass(driverClass);
    } catch (PropertyVetoException e) {
        dataSource = null;
        System.err.println("C3p0Plugin start error");
        throw new RuntimeException(e);
    }
    dataSource.setMaxPoolSize(maxPoolSize);
    dataSource.setMinPoolSize(minPoolSize);
    dataSource.setInitialPoolSize(initialPoolSize);
    dataSource.setMaxIdleTime(maxIdleTime);
    dataSource.setAcquireIncrement(acquireIncrement);
    isStarted = true;
    return true;
}
Also used : PropertyVetoException(java.beans.PropertyVetoException) ComboPooledDataSource(com.mchange.v2.c3p0.ComboPooledDataSource)

Example 25 with PropertyVetoException

use of java.beans.PropertyVetoException in project databus by linkedin.

the class MysqlMaxSCNHandler method createConnectionPool.

private static ComboPooledDataSource createConnectionPool(StaticConfig staticConfig) throws DatabusException {
    ComboPooledDataSource cpds = new ComboPooledDataSource();
    try {
        cpds.setDriverClass(staticConfig.getDriverClass());
    } catch (PropertyVetoException e) {
        throw new DatabusException("Unable to create connection pool", e);
    }
    cpds.setJdbcUrl(staticConfig.getJdbcUrl());
    cpds.setUser(staticConfig.getDbUser());
    cpds.setPassword(staticConfig.getDbPassword());
    //TODO : Default connection pool setting, make it configurable
    return cpds;
}
Also used : PropertyVetoException(java.beans.PropertyVetoException) ComboPooledDataSource(com.mchange.v2.c3p0.ComboPooledDataSource) DatabusException(com.linkedin.databus2.core.DatabusException)

Aggregations

PropertyVetoException (java.beans.PropertyVetoException)49 JInternalFrame (javax.swing.JInternalFrame)12 Date (java.util.Date)7 ComboPooledDataSource (com.mchange.v2.c3p0.ComboPooledDataSource)4 PropertyChangeEvent (java.beans.PropertyChangeEvent)4 Point (java.awt.Point)3 VetoableChangeListener (java.beans.VetoableChangeListener)3 SQLException (java.sql.SQLException)3 OBlock (jmri.jmrit.logix.OBlock)3 OBlockManager (jmri.jmrit.logix.OBlockManager)3 ActionEvent (java.awt.event.ActionEvent)2 IndexedPropertyChangeEvent (java.beans.IndexedPropertyChangeEvent)2 VetoableChangeSupport (java.beans.VetoableChangeSupport)2 File (java.io.File)2 IOException (java.io.IOException)2 BigDecimal (java.math.BigDecimal)2 PreparedStatement (java.sql.PreparedStatement)2 ResultSet (java.sql.ResultSet)2 Timestamp (java.sql.Timestamp)2 ArrayList (java.util.ArrayList)2