/** * 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(); }
/** * INTERNAL: */ protected void processStructConverterConfig(StructConverterConfig converterClassConfig, DatabaseLogin login) { if (converterClassConfig != null) { Platform platform = login.getDatasourcePlatform(); if (platform instanceof DatabasePlatform){ Iterator i = converterClassConfig.getStructConverterClasses().iterator(); while (i.hasNext()) { String converterClassName = (String)i.next(); try { Class converterClass = m_classLoader.loadClass(converterClassName); StructConverter converter = null; if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){ try{ converter = (StructConverter)AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(converterClass)); }catch (PrivilegedActionException ex){ throw (Exception)ex.getCause(); } }else{ converter = (StructConverter)PrivilegedAccessHelper.newInstanceFromClass(converterClass); } ((DatabasePlatform)platform).addStructConverter(converter); } catch (Exception exception) { throw SessionLoaderException.failedToLoadTag("struct-converter", converterClassName, exception); } } } } }
/** * 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(); }
Platform platform = login.getDatasourcePlatform(); if (platform instanceof DatabasePlatform){ Iterator i = converterClassConfig.getStructConverterClasses().iterator();
Platform platform = login.getDatasourcePlatform(); if (platform instanceof DatabasePlatform){ Iterator i = converterClassConfig.getStructConverterClasses().iterator();
/** * PUBLIC: * Add the sequence to the session. * Allows to add a new sequence to the session even if the session is connected. * If the session is connected then the sequence is added only * if there is no sequence with the same name already in use. * Call this method before addDescriptor(s) if need to add new descriptor * with a new non-default sequence to connected session. * * @see #addSequences(Collection) */ public void addSequence(Sequence sequence) { getProject().getLogin().getDatasourcePlatform().addSequence(sequence, this.getSequencingHome().isConnected()); }
/** * PUBLIC: * Add the sequence to the session. * Allows to add a new sequence to the session even if the session is connected. * If the session is connected then the sequence is added only * if there is no sequence with the same name already in use. * Call this method before addDescriptor(s) if need to add new descriptor * with a new non-default sequence to connected session. * * @see #addSequences(Collection) */ @Override public void addSequence(Sequence sequence) { getProject().getLogin().getDatasourcePlatform().addSequence(sequence, this.getSequencingHome().isConnected()); }