JDBC Connection Cheatsheet
Whether directly accessing a database or setting up a DataSource in a container, the developer must know the name of the driver and the connection string. The following table lists the most common databases with their driver name and a sample connection string

To load the driver, you can call the Class.forName method: Class.forName("org.hsqldb.jdbcDriver");
For direct connections, use the DriverManager and pass the connection string, username and password:
DriverManager.getConnection("jdbc:hsqldb:hsql://localhost/dbname", "sa", "");
The actual steps for adding a DataSource to your container will vary

HSQL
Driver Nameorg.hsqldb.jdbcDriver
Server Connectionjdbc:hsqldb:hsql://hostname/dbname
Embedded Connectionjdbc:hsqldb:c:/foldername/dbname
Username/PWsa or SA/blank
Filenamehsqldb.jar
MySQL
Driver Namecom.mysql.jdbc.Driver
Server Connectionjdbc:mysql://host_name:port/dbname
Username/PW 
Filename 
Derby
Driver Nameorg.apache.derby.jdbc.EmbeddedDriver
Server Connectionjdbc:derby://localhost:1527/myDB;create=true;user=me;password=mine
Username/PW 
Filename 
Cloudscape
Driver Namecom.ibm.db2j.jdbc.DB2jDriver
Server Connectionjdbc:db2j:HelloWorldDB;create=true
Username/PW 
Filename 
Oracle XE
Driver Nameoracle.jdbc.driver.OracleDriver
Server Connectionjdbc:oracle:thin:@localhost:1521:XE
Username/PW 
Filename 
DB2
Driver Namecom.ibm.db2.DB2Driver
Server Connectionjdbc:db2:
Username/PW 
Filename 
SQLServer
Driver Namecom.mysql.jdbc.Driver
Server Connectionjdbc:
Username/PW 
Filename