Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 20th, 2012  |  syntax: None  |  size: 0.56 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import javax.sql.DataSource;
  2. import org.apache.commons.dbcp.BasicDataSource;
  3. import org.springframework.context.annotation.Bean;
  4. import org.springframework.context.annotation.Configuration;
  5.  
  6. @Configuration
  7. public class ContextConfiguration {
  8.  
  9.     @Bean
  10.     public DataSource dataSource() {
  11.         final BasicDataSource ds = new BasicDataSource();
  12.         ds.setDriverClassName("org.h2.Driver");
  13.         ds.setUrl("jdbc:h2:~/workspace/h2/spring-noxmal;DB_CLOSE_ON_EXIT=FALSE;TRACE_LEVEL_FILE=4;AUTO_SERVER=TRUE");
  14.         ds.setUsername("sa");
  15.         return ds;
  16.     }
  17.  
  18. }