While establishing the connection to a MySQL database, I\'m getting the following error
java.sql.SQLException: Unknown initial character set index \'255\' receiv
The way I fixed it : Add characterEncoding=utf8 to the end of jdbc connection string
E.g. connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/photo_app?" + "user=root&password=root&characterEncoding=utf8");
connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/photo_app?" + "user=root&password=root&characterEncoding=utf8");