I am using Java Server Pages and got problem with collation when inserting data from my application. My insert code looks like this:
<%@page import="java.sql.*" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<% Class.forName( "com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/myapp", "root", "");
Statement st=con.createStatement();
ResultSet rs;
st.executeUpdate("insert into table values (default,1,2,šđžćč)"); %>
In my database result looks like this š?ž?? (so he can see understand 2 letters but not all). How to fix it so all letters will be in my database?
EDIT : I can insert data with those characters via phpmyadmin, but i can't from .jsp file to database. It's like charset = utf-8 on my jsp file is not working.