diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ConnectionProperties.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ConnectionProperties.java index b0276e7be04..272a20d75a5 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ConnectionProperties.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ConnectionProperties.java @@ -16,7 +16,8 @@ package org.springframework.jdbc.datasource.embedded; /** - * Allows DataSource connection properties to be configured in a DataSource implementation independent manner. + * DataSourceFactory helper that allows essential JDBC connection properties to be configured consistently, + * independent of the actual DataSource implementation. * @author Keith Donald * @see DataSourceFactory */ diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DataSourceFactory.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DataSourceFactory.java index 8a67f996be9..ac41fab3942 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DataSourceFactory.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DataSourceFactory.java @@ -20,7 +20,7 @@ import javax.sql.DataSource; import org.springframework.jdbc.datasource.SimpleDriverDataSource; /** - * A factory for DataSource implementation, such as a {@link SimpleDriverDataSource} or connection pool such as Apache DBCP or c3p0. + * Encapsulates the creation of a particular DataSource implementation, such as a {@link SimpleDriverDataSource} or connection pool such as Apache DBCP or c3p0. * Call {@link #getConnectionProperties()} to configure normalized DataSource properties before calling {@link #getDataSource()} to actually get the configured DataSource instance. * @author Keith Donald */ diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DatabasePopulator.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DatabasePopulator.java index 7ecc65f8c97..c170a2187a3 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DatabasePopulator.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DatabasePopulator.java @@ -19,7 +19,7 @@ import java.sql.Connection; import java.sql.SQLException; /** - * Strategy for populating a database with data. + * Strategy used to populate an embedded database during initialization. * @author Keith Donald * @see ResourceDatabasePopulator */ diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerFactory.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerFactory.java index 80e7b04a04a..d071ce6305f 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerFactory.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerFactory.java @@ -18,7 +18,7 @@ package org.springframework.jdbc.datasource.embedded; import org.springframework.util.Assert; /** - * Package private factory for mapping well-known {@link EmbeddedDatabaseType embedded database types} to + * Maps well-known {@link EmbeddedDatabaseType embedded database types} to * {@link EmbeddedDatabaseConfigurer} strategies. * @author Keith Donald */ diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java index d0b89015d41..56be3cd8cf2 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java @@ -26,13 +26,13 @@ import org.apache.commons.logging.LogFactory; import org.springframework.util.Assert; /** - * Returns a {@link EmbeddedDatabase} instance pre-populated with test data. When the database is returned, callers are - * guaranteed that the database schema and test data will have already been loaded. + * Creates a {@link EmbeddedDatabase} instance. + * Callers are guaranteed that the returned database has been fully initialized and populated. *

* Can be configured:
* Call {@link #setDatabaseName(String)} to change the name of the database.
* Call {@link #setDatabaseType(EmbeddedDatabaseType)} to set the database type if you wish to use one of the supported types.
- * Call {@link #setDatabaseConfigurer(EmbeddedDatabaseConfigurer)} to set a configuration strategy for your own embedded database type.
+ * Call {@link #setDatabaseConfigurer(EmbeddedDatabaseConfigurer)} to configure support for your own embedded database type.
* Call {@link #setDatabasePopulator(DatabasePopulator)} to change the algorithm used to populate the database.
* Call {@link #setDataSourceFactory(DataSourceFactory)} to change the type of DataSource used to connect to the database.
* Call {@link #getDatabase()} to get the {@link EmbeddedDatabase} instance.
diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType.java index 93c12798fa9..30085eb3ebf 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType.java @@ -18,7 +18,6 @@ package org.springframework.jdbc.datasource.embedded; /** * A supported embedded database type. * @author Keith Donald - * @see HsqlEmbeddedDatabaseConfigurer */ public enum EmbeddedDatabaseType { HSQL; diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ResourceDatabasePopulator.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ResourceDatabasePopulator.java index 1f3fe2e68f1..fe9659d09d6 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ResourceDatabasePopulator.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ResourceDatabasePopulator.java @@ -33,10 +33,11 @@ import org.springframework.util.StringUtils; /** * Populates a database from schema and test-data SQL defined in external resources. By default, looks for a schema.sql * file and test-data.sql resource in the root of the classpath. - * - * May be configured. Call {@link #setSchemaLocation(Resource)} to configure the location of the database schema file. - * Call {@link #setTestDataLocation(Resource)} to configure the location of the test data file. Call - * {@link #setSqlScriptEncoding(String)} to set the encoding for the schema and test data SQL. + *

+ * May be configured:
+ * Call {@link #setSchemaLocation(Resource)} to configure the location of the database schema file.
+ * Call {@link #setTestDataLocation(Resource)} to configure the location of the test data file.
+ * Call {@link #setSqlScriptEncoding(String)} to set the encoding for the schema and test data SQL.
*/ public class ResourceDatabasePopulator implements DatabasePopulator { diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/SimpleDriverDataSourceFactory.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/SimpleDriverDataSourceFactory.java index 22d370f1e6e..bce72df6778 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/SimpleDriverDataSourceFactory.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/SimpleDriverDataSourceFactory.java @@ -1,9 +1,28 @@ +/* + * Copyright 2002-2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.jdbc.datasource.embedded; import javax.sql.DataSource; import org.springframework.jdbc.datasource.SimpleDriverDataSource; +/** + * Creates a {@link SimpleDriverDataSource}. + * @author Keith Donald + */ final class SimpleDriverDataSourceFactory implements DataSourceFactory { private SimpleDriverDataSource dataSource = new SimpleDriverDataSource();