@Override public Connection connect(Properties properties, Session session) { Connection orig = target.connect(properties, session); return new ConnectionSpy(orig); }
@Override public String getConnectionDetails() { return target.getConnectionDetails(); }
@Override public void toString(PrintWriter writer) { target.toString(writer); }
/** * INTERNAL: * Clone the login. * This also clones the platform as it is internal to the login. */ @Override public DatasourceLogin clone() { DatasourceLogin clone = null; try { clone = (DatasourceLogin)super.clone(); } catch (Exception exception) { throw new AssertionError(exception); } if (getConnector() != null) { clone.setConnector((Connector)getConnector().clone()); } clone.setDatasourcePlatform((Platform)getDatasourcePlatform().clone()); clone.setProperties((Properties)properties.clone()); return clone; }
/** * INTERNAL: * Clone the login. * This also clones the platform as it is internal to the login. */ public DatasourceLogin clone() { DatasourceLogin clone = null; try { clone = (DatasourceLogin)super.clone(); } catch (Exception exception) { // should not happen...do nothing } if (getConnector() != null) { clone.setConnector((Connector)getConnector().clone()); } clone.setDatasourcePlatform((Platform)getDatasourcePlatform().clone()); clone.setProperties((Properties)properties.clone()); return clone; }
/** * INTERNAL: * Connect to the datasource, and return the driver level connection object. */ @Override public Object connectToDatasource(Accessor accessor, Session session) throws DatabaseException { return getConnector().connect(prepareProperties(properties), session); }
/** * PUBLIC: * Print all of the connection information. */ public String toString() { StringWriter stringWriter = new StringWriter(); PrintWriter writer = new PrintWriter(stringWriter); writer.write(Helper.getShortClassName(getClass())); writer.println("("); writer.println("\t" + ToStringLocalization.buildMessage("platform", (Object[])null) + "=> " + getDatasourcePlatform()); if (!shouldUseExternalConnectionPooling()) { writer.println("\t" + ToStringLocalization.buildMessage("user_name", (Object[])null) + "=> \"" + getUserName() + "\""); } writer.print("\t"); getConnector().toString(writer); writer.write(")"); return stringWriter.toString(); }
/** * Return JDBCConnection detail information. This includes URL and datasource information. */ public synchronized String getJdbcConnectionDetails() { return getSession().getLogin().getConnector().getConnectionDetails(); }
/** * INTERNAL: * Clone the login. * This also clones the platform as it is internal to the login. */ public Object clone() { DatasourceLogin clone = null; try { clone = (DatasourceLogin)super.clone(); } catch (Exception exception) { // should not happen...do nothing } if (getConnector() != null) { clone.setConnector((Connector)getConnector().clone()); } clone.setDatasourcePlatform((Platform)getDatasourcePlatform().clone()); clone.setProperties((Properties)properties.clone()); return clone; }
/** * INTERNAL: * Connect to the datasource, and return the driver level connection object. */ public Object connectToDatasource(Accessor accessor, Session session) throws DatabaseException { return getConnector().connect(prepareProperties(properties), session); }
/** * PUBLIC: * Print all of the connection information. */ public String toString() { StringWriter stringWriter = new StringWriter(); PrintWriter writer = new PrintWriter(stringWriter); writer.write(Helper.getShortClassName(getClass())); writer.println("("); writer.println("\t" + ToStringLocalization.buildMessage("platform", (Object[])null) + "=> " + getDatasourcePlatform()); if (!shouldUseExternalConnectionPooling()) { writer.println("\t" + ToStringLocalization.buildMessage("user_name", (Object[])null) + "=> \"" + getUserName() + "\""); } writer.print("\t"); getConnector().toString(writer); writer.write(")"); return stringWriter.toString(); }
/** * Return JDBCConnection detail information. This includes URL and datasource information. */ public synchronized String getJdbcConnectionDetails() { return getSession().getLogin().getConnector().getConnectionDetails(); }
/** * INTERNAL: * Connect to the datasource, and return the driver level connection object. */ public Object connectToDatasource(Accessor accessor, Session session) throws DatabaseException { return getConnector().connect(prepareProperties(properties), session); }
/** * PUBLIC: * Print all of the connection information. */ @Override public String toString() { StringWriter stringWriter = new StringWriter(); PrintWriter writer = new PrintWriter(stringWriter); writer.write(Helper.getShortClassName(getClass())); writer.println("("); writer.println("\t" + ToStringLocalization.buildMessage("platform", (Object[])null) + "=> " + getDatasourcePlatform()); if (!shouldUseExternalConnectionPooling()) { writer.println("\t" + ToStringLocalization.buildMessage("user_name", (Object[])null) + "=> \"" + getUserName() + "\""); } writer.print("\t"); getConnector().toString(writer); writer.write(")"); return stringWriter.toString(); }
/** * Return JDBCConnection detail information. This includes URL and datasource information. */ public synchronized String getJdbcConnectionDetails() { return getSession().getLogin().getConnector().getConnectionDetails(); }
/** * @see org.seasar.framework.jpa.Dialect#getConnection(javax.persistence.EntityManager) */ public Connection getConnection(EntityManager em) { Object delegate = em.getDelegate(); JpaEntityManager eclipselinkEm = JpaEntityManager.class.cast(delegate); ServerSession session = eclipselinkEm.getServerSession(); return session.getLogin().getConnector().connect( new Properties(), session); }
/** * PUBLIC: * Print all of the connection information. */ public String toString() { StringWriter stringWriter = new StringWriter(); PrintWriter writer = new PrintWriter(stringWriter); writer.println("DatabaseLogin("); writer.println("\t" + ToStringLocalization.buildMessage("platform", (Object[])null) + "=>" + getDatasourcePlatform()); writer.println("\t" + ToStringLocalization.buildMessage("user_name", (Object[])null) + "=> \"" + getUserName() + "\""); writer.print("\t"); getConnector().toString(writer); if (getServerName() != null) { writer.println("\t" + ToStringLocalization.buildMessage("server_name", (Object[])null) + "=> \"" + getServerName() + "\""); } if (getDatabaseName() != null) { writer.println("\t" + ToStringLocalization.buildMessage("database_name", (Object[])null) + "=> \"" + getDatabaseName() + "\""); } writer.write(")"); return stringWriter.toString(); }
/** * PUBLIC: * Print all of the connection information. */ public String toString() { StringWriter stringWriter = new StringWriter(); PrintWriter writer = new PrintWriter(stringWriter); writer.println("DatabaseLogin("); writer.println("\t" + ToStringLocalization.buildMessage("platform", (Object[])null) + "=>" + getDatasourcePlatform()); writer.println("\t" + ToStringLocalization.buildMessage("user_name", (Object[])null) + "=> \"" + getUserName() + "\""); writer.print("\t"); getConnector().toString(writer); if (getServerName() != null) { writer.println("\t" + ToStringLocalization.buildMessage("server_name", (Object[])null) + "=> \"" + getServerName() + "\""); } if (getDatabaseName() != null) { writer.println("\t" + ToStringLocalization.buildMessage("database_name", (Object[])null) + "=> \"" + getDatabaseName() + "\""); } writer.write(")"); return stringWriter.toString(); }
/** * PUBLIC: * Print all of the connection information. */ public String toString() { StringWriter stringWriter = new StringWriter(); PrintWriter writer = new PrintWriter(stringWriter); writer.println("DatabaseLogin("); writer.println("\t" + ToStringLocalization.buildMessage("platform", (Object[])null) + "=>" + getPlatform()); writer.println("\t" + ToStringLocalization.buildMessage("user_name", (Object[])null) + "=> \"" + getUserName() + "\""); writer.print("\t"); getConnector().toString(writer); if (getServerName() != null) { writer.println("\t" + ToStringLocalization.buildMessage("server_name", (Object[])null) + "=> \"" + getServerName() + "\""); } if (getDatabaseName() != null) { writer.println("\t" + ToStringLocalization.buildMessage("database_name", (Object[])null) + "=> \"" + getDatabaseName() + "\""); } writer.write(")"); return stringWriter.toString(); }