title: Error in running Java Code code ( Unknown character set: 'utf8mb4' )?
body: <p>Im trying to learn Java programming and how to link it with Database MySQL ... </p>
  
  <p>Here's the Code : </p>
  
  <pre><code>import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.PreparedStatement;
  import java.sql.ResultSet;
  
  
  public class main {
  
      public static void main(String[] args) 
      throws Exception 
      {
  
          System.out.println("Loading Driver ..");
          System.out.println("Loading Driver ...");
          System.out.println("Loading Driver ....");
          System.out.println("Loading Driver .....");
          Class.forName("com.mysql.jdbc.Driver");
  
          System.out.println("Driver Loaded");
  
          Connection con = DriverManager.getConnection("jdbc:mysql://localhost/javabook", "root", "1234"); //Connect
          System.out.println("Database Connected");
  
          PreparedStatement statement = con.prepareStatement(" SELECT * From acc_types");
  
          ResultSet result = statement.executeQuery();
  
          while (result.next())
          {
              System.out.println(result.getString(1)+ ""+result.getString(2));
          }
  
  
  
  
  
  }
  }
  </code></pre>
  
  <p>says : </p>
  
  <pre><code>Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown character set: 'utf8mb4'
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      at java.lang.reflect.Constructor.newInstance(Unknown Source)
      at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
      at com.mysql.jdbc.Util.getInstance(Util.java:386)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163)
      at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2618)
      at com.mysql.jdbc.ConnectionImpl.configureClientCharacterSet(ConnectionImpl.java:1880)
      at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3499)
      at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2384)
      at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2153)
      at com.mysql.jdbc.ConnectionImpl.&lt;init&gt;(ConnectionImpl.java:792)
      at com.mysql.jdbc.JDBC4Connection.&lt;init&gt;(JDBC4Connection.java:47)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      at java.lang.reflect.Constructor.newInstance(Unknown Source)
      at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
      at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381)
      at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at main.main(main.java:22)
  </code></pre>
  
  <p>well i've been searching on Google and YouTube and no answer for such a problem ... and i've installed the programs well according to this tutorial step by step ... 
  ( <a href="http://www.youtube.com/watch?v=E30_-pQGQXs" rel="nofollow">http://www.youtube.com/watch?v=E30_-pQGQXs</a> ) </p>
  
  <p>I really need help .... </p>