Get messages from Database using JDBC