import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
private Connection conn;
public void init()
{
try
{
Class.forName( "com.mysql.jdbc.Driver" ));
}
catch ( Exception e )
{
System.out.println( "can't load MySQL driver: " + e.getMessage() );
}
try
{
conn = DriverManager.getConnection( "jdbc:mysql://localhost/allaboutsquirrels", "myuserid", "mypassword" );
}
catch ( SQLException e )
{
System.out.println( "can't connect to MySQL: " + e.getMessage() );
}
}
...
Statement stmt = conn.createStatement();