Lines 130-143
Link Here
|
130 |
super(name); |
130 |
super(name); |
131 |
} |
131 |
} |
132 |
|
132 |
|
|
|
133 |
protected static JDBCDriver getJDBCDriver() throws Exception{ |
134 |
if (jdbcDriver == null) { |
135 |
jdbcDriver = JDBCDriver.create("derbydriver", "derbydriver", driverClass, new URL[] {driverJarUrl}); |
136 |
assertNotNull(jdbcDriver); |
137 |
JDBCDriverManager.getDefault().addDriver(jdbcDriver); |
138 |
} |
139 |
|
140 |
return jdbcDriver; |
141 |
|
142 |
} |
143 |
|
133 |
/** |
144 |
/** |
134 |
* Get the DatabaseConnection for the configured Java DB database. This |
145 |
* Get the DatabaseConnection for the configured Java DB database. This |
135 |
* method will create and register the connection the first time it is called |
146 |
* method will create and register the connection the first time it is called |
136 |
*/ |
147 |
*/ |
137 |
protected static DatabaseConnection getDatabaseConnection() throws Exception { |
148 |
protected static DatabaseConnection getDatabaseConnection() throws Exception { |
138 |
if (dbConnection == null) { |
149 |
if (dbConnection == null) { |
139 |
JDBCDriver driver = JDBCDriver.create("derbydriver", "derbydriver", driverClass, new URL[] {driverJarUrl}); |
150 |
JDBCDriver driver = getJDBCDriver(); |
140 |
JDBCDriverManager.getDefault().addDriver(driver); |
|
|
141 |
|
151 |
|
142 |
dbConnection = DatabaseConnection.create(driver, dbUrl, username, "APP", password, false); |
152 |
dbConnection = DatabaseConnection.create(driver, dbUrl, username, "APP", password, false); |
143 |
ConnectionManager.getDefault().addConnection(dbConnection); |
153 |
ConnectionManager.getDefault().addConnection(dbConnection); |
Lines 208-214
Link Here
|
208 |
conn = DriverManager.getConnection(dbUrl, username, password); |
218 |
conn = DriverManager.getConnection(dbUrl, username, password); |
209 |
return conn; |
219 |
return conn; |
210 |
} |
220 |
} |
211 |
|
221 |
|
212 |
protected void createSchema() throws Exception { |
222 |
protected void createSchema() throws Exception { |
213 |
dropSchema(); |
223 |
dropSchema(); |
214 |
conn.createStatement().executeUpdate("CREATE SCHEMA " + SCHEMA); |
224 |
conn.createStatement().executeUpdate("CREATE SCHEMA " + SCHEMA); |