Spring Framework JdbcAccessor - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework JdbcAccessor class.

This code example shows how to use the following methods:getDataSource
 
	/** 
	 * Set the JDBC DataSource to be used by this DAO. 
	 */ 
	public final void setDataSource(DataSource dataSource) { 
		if (this.jdbcTemplate == null || dataSource != this.jdbcTemplate.getDataSource()) { 
			this.jdbcTemplate = createJdbcTemplate(dataSource); 
			initTemplateConfig(); 
		} 
	} 
 
	/** 
	 * Create a JdbcTemplate for the given DataSource. 
	 * Only invoked if populating the DAO with a DataSource reference! 
	 * <p>Can be overridden in subclasses to provide a JdbcTemplate instance 
	 * with different configuration, or a custom JdbcTemplate subclass. 
	 * @param dataSource the JDBC DataSource to create a JdbcTemplate for 
	 * @return the new JdbcTemplate instance 
	 * @see #setDataSource 
	 */ 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getDataSource
	 * @see ResourceDatabasePopulator 
	 * @see #setSqlScriptEncoding 
	 */ 
	protected void executeSqlScript(String sqlResourcePath, boolean continueOnError) throws DataAccessException { 
		Resource resource = this.applicationContext.getResource(sqlResourcePath); 
		new ResourceDatabasePopulator(continueOnError, false, this.sqlScriptEncoding, resource).execute(jdbcTemplate.getDataSource()); 
	} 
 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getDataSource
	 * @see ResourceDatabasePopulator 
	 * @see #setSqlScriptEncoding 
	 */ 
	protected void executeSqlScript(String sqlResourcePath, boolean continueOnError) throws DataAccessException { 
		Resource resource = this.applicationContext.getResource(sqlResourcePath); 
		new ResourceDatabasePopulator(continueOnError, false, this.sqlScriptEncoding, resource).execute(jdbcTemplate.getDataSource()); 
	} 
 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getDataSource
	 * or {@link org.springframework.jdbc.datasource.init.ResourceDatabasePopulator}. 
	 */ 
	@Deprecated 
	public static void executeSqlScript(JdbcTemplate jdbcTemplate, EncodedResource resource, boolean continueOnError) 
			throws DataAccessException { 
		new ResourceDatabasePopulator(continueOnError, false, resource.getEncoding(), resource.getResource()).execute(jdbcTemplate.getDataSource()); 
	} 
 
	/** 
	 * Read a script from the provided {@code LineNumberReader}, using 
	 * "{@code --}" as the comment prefix, and build a {@code String} containing 
	 * the lines. 
	 * @param lineNumberReader the {@code LineNumberReader} containing the script 
	 * to be processed 
	 * @return a {@code String} containing the script lines 
	 * @see #readScript(LineNumberReader, String) 
	 * @deprecated as of Spring 4.0.3, in favor of using 
	 * {@link org.springframework.jdbc.datasource.init.ScriptUtils#readScript(LineNumberReader, String, String)} 
	 */ 
	@Deprecated 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getExceptionTranslator
	 * @return the corresponding DataAccessException instance 
	 * @see #setExceptionTranslator 
	 * @see org.apache.ojb.broker.accesslayer.ConnectionManagerIF#getConnection 
	 */ 
	protected DataAccessException convertJdbcAccessException(SQLException ex) { 
		return getExceptionTranslator().translate("OJB operation", null, ex); 
	} 
 
} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Spring Framework JdbcAccessor Methods: