String url ="jdbc:mysql://localhost/rajdb?"+
                "user=username&password=yourpassword&useUnicode=true&characterEndcoding=GB2312";
    String driverName ="org.gjt.mm.mysql.Driver";
    try {
      Class.forName(driverName);
    } catch(ClassNotFoundException e){
  e.printStackTrace();
    }
    try {
    connection=DriverManager.getConnection(url);
    statement=connection.createStatement();
    } catch(SQLException e) {
           e.printStackTrace();
    }