FileDocCategorySizeDatePackage
DatabaseConnector.javaAPI DocExample722Wed Apr 05 20:05:42 BST 2006None

DatabaseConnector

public class DatabaseConnector extends Object

Fields Summary
Constructors Summary
Methods Summary
public static java.sql.ConnectiongetConnection()

	        Connection con = null;
	        String driver = "com.mysql.jdbc.Driver";
	        try {
	            Class.forName(driver).newInstance();

	        } catch (Exception e) {
	            System.out.println("Failed to load mySQL driver.");
	            return null;
	        }
	        try {
	            con = DriverManager
	                    .getConnection("jdbc:mysql:///AJAX?user=ajax&password=aardvark");

	        } catch (Exception e) {
	            e.printStackTrace();
	        }
	        return con;