Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * This class represents a DAO factory for a SQL database. You can use {@link #getInstance(String)}
- * to obtain a new instance for the given database name. The specific instance returned depends on
- * the properties file configuration. You can obtain DAO's for the DAO factory instance using the
- * DAO getters.
- * <p>
- * This class currently requires a properties file named 'dao.properties' in the classpath with among others
- * the following properties:
- * <pre>
- * name.url *
- * name.driver
- * name.username
- * name.password
- * </pre>
- * Those marked with * are required, others are optional and can be left away or empty. Only the
- * username is required when any password is specified.
- * <ul>
- * <li>The 'name' must represent the database name in {@link #getInstance(String)}.</li>
- * <li>The 'name.url' must represent either the JDBC URL or JNDI name of the database.</li>
- * <li>The 'name.driver' must represent the full qualified class name of the JDBC driver.</li>
- * <li>The 'name.username' must represent the username of the database login.</li>
- * <li>The 'name.password' must represent the password of the database login.</li>
- * </ul>
- * If you specify the driver property, then the url property will be assumed as JDBC URL. If you
- * omit the driver property, then the url property will be assumed as JNDI name. When using JNDI
- * with username/password preconfigured, you can omit the username and password properties as well.
- * <p>
- * Here are basic examples of valid properties for a database with the name 'javabase':
- * <pre>
- * javabase.jdbc.url = jdbc:mysql://localhost:3306/javabase
- * javabase.jdbc.driver = com.mysql.jdbc.Driver
- * javabase.jdbc.username = java
- * javabase.jdbc.password = d$7hF_r!9Y
- * </pre>
- * <pre>
- * javabase.jndi.url = jdbc/javabase
- * </pre>
- * Here is a basic use example:
- * <pre>
- * DAOFactory javabase = DAOFactory.getInstance("javabase.jdbc");
- * UserDAO userDAO = javabase.getUserDAO();
- * </pre>
- *
- * @author Leon Merten
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement