Here you can find the source of createTables(final DataSource ds)
Parameter | Description |
---|---|
ds | the DataSource to CREATE into |
public static void createTables(final DataSource ds)
//package com.java2s; //License from project: Apache License import javax.sql.DataSource; public class Main { /**//w w w .j a va2 s . com * Creates the tables in the database * @param ds the DataSource to CREATE into */ public static void createTables(final DataSource ds) { try { final String stmt = "create table USERS(username varchar(50), email varchar(50), Primary Key (username));"; ds.getConnection().prepareStatement(stmt).execute(); } catch (Exception e) { // do nothing -- probably just called twice as part of a unit tests } } }