Development of web-applications with the help of Spring MVC implies creation of several logical layers of architecture. One of the layers is a DAO (Repository) layer. It is responsible for communication with a database. If you developed the DAO layer at least once, you should know that it involves a lot of boilerplate code. A Spring Data take a part ...
Read More »Spring MVC: Security with MySQL and Hibernate
Spring has a lot of different modules. All of them are useful for the concrete purposes. Today I’m going to talk about Spring Security. This module provides flexible approach to manage permitions for access to different parts of web-application. In the post I’ll examine integration of Spring MVC, Hibernate, MySQL with Spring Security. A regular case for any web-application is ...
Read More »Caveats With MySQL Pagination
We’ve all done pagination – it’s sensible for both lists in the UI and for processing data in batches. “SELECT (columns) FROM table LIMIT X, Y”. Possibly “SELECT (columns) FROM table ORDER BY some_column LIMIT X, Y”. What’s the caveat? Especially when working with an ORM and when processing batches, where order doesn’t matter, you are likely to omit the ...
Read More »MySql connections autodrop after a certain hours
MySql is configured to drop any connection which has been Idle for more than 8 hours. What is the implication of this? After you return to your deployed app after a gap of 8 hours (If default SQL parameters have not been changed), you will be greeted with an exception. How to solve this issue? Increase the wait_time parameter -Not ...
Read More »Getting started with Quartz Scheduler on MySQL database
Here are some simple steps to get you fully started with Quartz Scheduler on MySQL database using Groovy. The script below will allow you to quickly experiment different Quartz configuration settings using an external file. First step is to setup the database with tables. Assuming you already have installed MySQL and ...
Read More »Debugging SQL query in MySQL
Recently I started writing SQL query for analyzing and debugging the production code. But I was surprised to see that some queries takes longer time to execute to achieve the same output. I did research and found some interesting stuff about how to debug the SQL query. I have a very simple table who’s definition is as following. In test ...
Read More »Load or Save Image using Hibernate – MySQL
This tutorial will walk you throughout how to save and load an image from database (MySQL) using Hibernate. Requirements For this sampel project, we are going to use: Eclipse IDE (you can use your favorite IDE); MySQL(you can use any other database, make sure to change the column type if required); Hibernate jars and dependencies (you can download the sample ...
Read More »Arquillian with NetBeans, WebLogic 12c, JPA and a MySQL Datasource
You probably followed my posts about testing more complex scenarios with embedded GlassFish (Part I / Part II). Next on my list of things to do was to get this setup working with latest WebLogic 12c. Getting Started Follow the steps in the getting started part of my first two posts. There are only a few things you have to ...
Read More »Configuring MyBatis 3
MyBatis is a very popular and also most efficient SQL mapping framework. MyBatis is available for both in java as well as .net language. MyBatis is not really an alternative of Hibernate but we can use this framework to reduce our database related code with efficient and high performance provided by MyBatis. This tutorial will show you the steps to ...
Read More »