Java DataSource createDataSource()

Here you can find the source of createDataSource()

Description

create Data Source

License

Open Source License

Declaration

public static DataSource createDataSource() 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import javax.sql.DataSource;

import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;

public class Main {
    public static DataSource createDataSource() {
        MysqlDataSource ds = new MysqlDataSource();
        ds.setUser("root");
        ds.setPassword("sP6prUCe");
        ds.setServerName("localhost");
        ds.setDatabaseName("db_patterns");
        return ds;
    }/*w  w  w. jav a  2 s . c  o  m*/
}

Related

  1. assertNotNull(DataSource dataSource)
  2. batchExecute(DataSource ds, String sql, Object[]... args)
  3. checkTableExists(DataSource dataSource, String tableName)
  4. cleanDB(String ip, DataSource dataSource)
  5. countTable(DataSource dataSource, String tableName)
  6. createDataTable(DataSource dataSource, String tableName)
  7. createDerbyEmbeddedDataSource(Properties props)
  8. createTable(DataSource ds, String ddl)
  9. createTable(DataSource ds, String tableName)