Spring Framework SimpleJdbcDaoSupport - 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 SimpleJdbcDaoSupport class.

This code example shows how to use the following methods:getJdbcTemplate, setDataSource
 
  @Test 
  public void testHiveInstall() { 
    HiveConfigurationSchemaInstaller installer = new HiveConfigurationSchemaInstaller(getConnectString(TEST_DB)); 
    installer.run(); 
    JdbcDaoSupport dao = new SimpleJdbcDaoSupport(); 
    dao.setDataSource(getDataSource(TEST_DB)); 
    int rowCount = dao.getJdbcTemplate().queryForInt("select count(1) from semaphore_metadata"); 
    Assert.assertEquals(1, rowCount); 
  } 
 
  @Override 
  public Collection<String> getDatabaseNames() { 
    return Arrays.asList(new String[]{TEST_DB}); 
  } 
} 
6
CodeRank
This code example shows how to use the following methods:
 *  
 * @author Nicholas Blair, npblair@wisc.edu 
 * @author Susan Bramhall, susan.bramhall@yale.edu 
 * 
 */ 
public class UserLayoutHelperImpl extends SimpleJdbcDaoSupport implements IUserLayoutHelper {
 
	protected static final String DEFAULT_LAYOUT_FNAME = "default";
	 
	protected final Log logger = LogFactory.getLog(this.getClass());
	private IUserIdentityStore userIdentityStore;
 
	/** 
	 * @param userIdentityStore the userIdentityStore to set 
	 */ 
	@Autowired 
	public void setUserIdentityStore(IUserIdentityStore userIdentityStore) {
		this.userIdentityStore = userIdentityStore;
	} 
 
5
CodeRank
This code example shows how to use the following methods:
import org.springframework.jdbc.core.RowMapper; 
import org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport; 
import org.talend.esb.sam.server.persistence.dialects.DatabaseDialect; 
import org.talend.esb.sam.server.ui.CriteriaAdapter; 
 
public class SAMProviderImpl extends SimpleJdbcDaoSupport implements SAMProvider { 
 
    private static final String SELECT_FLOW_QUERY = "select " 
            + "EVENTS.ID, EI_TIMESTAMP, EI_EVENT_TYPE, ORIG_CUSTOM_ID, ORIG_PROCESS_ID, " 
            + "ORIG_HOSTNAME, ORIG_IP, ORIG_PRINCIPAL, MI_PORT_TYPE, MI_OPERATION_NAME, " 
            + "MI_MESSAGE_ID, MI_FLOW_ID, MI_TRANSPORT_TYPE, CONTENT_CUT, " + "CUST_KEY, CUST_VALUE " + "from EVENTS " 
            + "left join EVENTS_CUSTOMINFO on EVENTS_CUSTOMINFO.EVENT_ID = EVENTS.ID " + "where MI_FLOW_ID = :flowID"; 
 
    private static final String SELECT_EVENT_QUERY = "select " 
            + "ID, EI_TIMESTAMP, EI_EVENT_TYPE, ORIG_CUSTOM_ID, ORIG_PROCESS_ID, " 
            + "ORIG_HOSTNAME, ORIG_IP, ORIG_PRINCIPAL, MI_PORT_TYPE, MI_OPERATION_NAME, " 
            + "MI_MESSAGE_ID, MI_FLOW_ID, MI_TRANSPORT_TYPE, CONTENT_CUT, MESSAGE_CONTENT " 
            + "from EVENTS where ID = :eventID"; 
 
    private DatabaseDialect dialect; 
5
CodeRank
This code example shows how to use the following methods:
 * Default implementation of {@link UIProvider} based on. 
 * 
 * {@link SimpleJdbcDaoSupport} 
 * @author zubairov 
 */ 
public class UIProviderImpl extends SimpleJdbcDaoSupport implements UIProvider { 
 
    private static final String COUNT_QUERY = "select count(distinct MI_FLOW_ID) from EVENTS " + 
            DatabaseDialect.SUBSTITUTION_STRING; 
 
    private static final String SELECT_FLOW_QUERY = "select " 
            + "EVENTS.ID, EI_TIMESTAMP, EI_EVENT_TYPE, ORIG_CUSTOM_ID, ORIG_PROCESS_ID, " 
            + "ORIG_HOSTNAME, ORIG_IP, ORIG_PRINCIPAL, MI_PORT_TYPE, MI_OPERATION_NAME, " 
            + "MI_MESSAGE_ID, MI_FLOW_ID, MI_TRANSPORT_TYPE, CONTENT_CUT, " 
            + "CUST_KEY, CUST_VALUE " 
            + "from EVENTS " 
            + "left join EVENTS_CUSTOMINFO on EVENTS_CUSTOMINFO.EVENT_ID = EVENTS.ID " 
            + "where MI_FLOW_ID = :flowID"; 
 
    private static final String SELECT_EVENT_QUERY = "select " 
4
CodeRank
This code example shows how to use the following methods:
 
/** 
 * 
 * @author thomas 
 */ 
public class MetaDataFilter extends SimpleJdbcDaoSupport 
{ 
 
  private SubQueryCorpusSelectionStrategy subQueryCorpusSelectionStrategy; 
 
  /** 
   * Will query the database which documents are matching according to the 
   * given metadata 
   * @param queryData QueryData from which the meta data will be extracted 
   * @return The list of documents matching the meta data or null if no 
   *        constraints need to be applied (all documents are matching) 
   */ 
  public List<Long> getDocumentsForMetadata(QueryData queryData) 
  { 
    List<Long> corpusList = queryData.getCorpusList(); 
4
CodeRank
This code example shows how to use the following methods:getJdbcTemplate, getSimpleJdbcTemplate
				new BeanPropertyRowMapper<Movie>(Movie.class)); 
	} 
 
	@Override 
	public void create(Movie movie) { 
		getJdbcTemplate().update( 
				"insert into movies (title, description, director, genre, languages, " + 
				"starring, duration, year) values(?, ?, ?, ?, ?, ?, ?, ?)", 
				movie.getTitle(),  movie.getDescription(), movie.getDirector(), 
				movie.getGenre(), movie.getLanguages(), movie.getStarring(), 
				movie.getDuration(), movie.getYear()); 
		// Setear el id autogenerado por el identity de HSQL 
		movie.setId(getSimpleJdbcTemplate().queryForInt("call identity()")); 
		 
	} 
 
	@Override 
	public void update(Movie movie) { 
		getSimpleJdbcTemplate().update( 
				"update movies set title=?, description=?, director=?," + 
4
CodeRank
See Code Examples for Spring Framework SimpleJdbcDaoSupport Methods: