/** * Return the database name. * * @return the database name */ public String getDatabaseName() { return connectionPoolDataSource.getDatabaseName(); }
/** * Return the password credential used to establish the connection. * * @return the password credential used to establish the connection */ public String getPassword() { return connectionPoolDataSource.getPassword(); }
/** * Return the port number to connect to. * * @return the port number to connect to */ public Integer getPortNumber() { return connectionPoolDataSource.getPortNumber(); }
@Override public ConnectionPoolDataSource createConnectionPoolDataSource(Properties props) throws SQLException { ClientConnectionPoolDataSource ds = new ClientConnectionPoolDataSource(); setProperties(ds, props); return ds; }
/** * Return the user name used to establish the connection. * * @return the user name used to establish the connection */ public String getUserName() { return connectionPoolDataSource.getUser(); }
/** * Set whether the database should be created if it does not already exist. * * @param create TRUE if the database should be created */ public void setCreateDatabase(Boolean create) { Attributes attr = new Attributes(); try { attr = new Attributes(connectionPoolDataSource.getConnectionAttributes()); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } if (create) attr.setAttributeValue("create", "true"); else attr.remove("create"); connectionPoolDataSource.setConnectionAttributes(attr.toString()); }
/** * Return the name of the server to connect to. * * @return the name of the server to connect to */ public String getServerName() { return connectionPoolDataSource.getServerName(); }
/** * Set the database name. * * @param name the database name */ public void setDatabaseName(String name) { connectionPoolDataSource.setDatabaseName(name); }
/** * Return whether the client should retrieve the text of messages from the server. * * @return true if message text should be retrieved from the server */ public Boolean getRetrieveMessageText() { return connectionPoolDataSource.getRetrieveMessageText(); }
/** * Return whether the database should be created if it does not already exist. * * @return true if the database should be created */ public Boolean getCreateDatabase() { Attributes attr; try { attr = new Attributes(connectionPoolDataSource.getConnectionAttributes()); } catch (ParseException e) { return Boolean.FALSE; } String createDatabase = attr.getAttributeValue("create"); if (createDatabase == null) return(Boolean.FALSE); else return Boolean.parseBoolean(createDatabase); }
/** * Default constructor for a Derby Client Local DataSource. */ public ClientLocalMCF() { super(new ClientConnectionPoolDataSource(), new NoExceptionsAreFatalSorter()); }