package org.springframework.roo.addon.jpa;

import org.springframework.roo.support.style.ToStringCreator;

/**
 * Provides information related to JDBC database configuration.
 * 
 * @author Stefan Schmidt
 * @author Alan Stewart
 * @since 1.0
 */
public enum JdbcDatabase {
	H2_IN_MEMORY("H2", "org.h2.Driver", "jdbc:h2:mem:TO_BE_CHANGED_BY_ADDON;DB_CLOSE_DELAY=-1"), 
	HYPERSONIC_IN_MEMORY("HYPERSONIC", "org.hsqldb.jdbcDriver", "jdbc:hsqldb:mem:TO_BE_CHANGED_BY_ADDON"), 
	HYPERSONIC_PERSISTENT("HYPERSONIC", "org.hsqldb.jdbcDriver", "jdbc:hsqldb:${user.home}/TO_BE_CHANGED_BY_ADDON;shutdown=true"), 
	POSTGRES("POSTGRES", "org.postgresql.Driver", "jdbc:postgresql://localhost:5432"), 
	MYSQL("MYSQL", "com.mysql.jdbc.Driver", "jdbc:mysql://localhost:3306"), 
	ORACLE("ORACLE", "oracle.jdbc.OracleDriver", "jdbc:oracle:thin:@localhost:1521"), 
	SYBASE("SYBASE", "com.sybase.jdbc2.jdbc.SybDriver", "jdbc:sybase:Tds:localhost:4100"), 
	MSSQL("MSSQL", "com.microsoft.sqlserver.jdbc.SQLServerDriver", "jdbc:microsoft:sqlserver://localhost:1433"), 
	DB2("DB2", "com.ibm.db2.jcc.DB2Driver", "jdbc:db2://localhost:50000"), 
	DB2400("DB2400", "com.ibm.as400.access.AS400JDBCDriver", "jdbc:as400://localhost"), 
	DERBY("DERBY", "org.apache.derby.jdbc.EmbeddedDriver", "jdbc:derby:TO_BE_CHANGED_BY_ADDON;create=true"),
	GOOGLE_APP_ENGINE("GAE", "", "appengine");

	private String key;
	private String connectionString;
	private String driverClassName;

	private JdbcDatabase(String key, String driverClassName, String connectionString) {
		this.key = key;
		this.driverClassName = driverClassName;
		this.connectionString = connectionString;
	}

	public String getKey() {
		return key;
	}

	public String getDriverClassName() {
		return driverClassName;
	}
	
	public String getConnectionString() {
		return connectionString;
	}

	public String toString() {
		ToStringCreator tsc = new ToStringCreator(this);
		tsc.append("name", name());
		tsc.append("key", key);
		tsc.append("driver class name", driverClassName);
		tsc.append("connection string", connectionString);
		return tsc.toString();
	}
}

@@ -862,33 +862,34 @@
 %22, %22
-com.sybase.jdbc2
+net.sourceforge.jtds
 .jdbc.
-Syb
 Driv
@@ -903,19 +903,22 @@
 dbc:
+jtds:
 sybase:
-Tds:
+//
 loca
@@ -927,72 +927,91 @@
 ost:
-4100%22), %0A%09MSSQL(%22MSSQL%22, %22com.microsoft.sqlserver.jdbc.SQLServer
+5000/TO_BE_CHANGED_BY_ADDON;TDS=4.2%22), %0A%09MSSQL(%22MSSQL%22, %22net.sourceforge.jtds.jdbc.
 Driv
@@ -1025,17 +1025,12 @@
 dbc:
-microsoft
+jtds
 :sql
@@ -1052,16 +1052,39 @@
 ost:1433
+/TO_BE_CHANGED_BY_ADDON
 %22), %0A%09DB

Change maven dependency for MSSQL and Sybase to the open source jTDS JDBC driver