Call Stored Procedure using Spring SimpleJdbcCall

This tutorial will show you how you can call or execute stored procedure using Spring SimpleJdbcCall. SimpleJdbcCall API provides flexible methods to invoke stored procedure. You can use DataSource directly with SimpleJdbcCall or you can create JdbcTemplate using DataSource and use JdbcTemplate with SimpleJdbcCall API for calling the stored procedures. You can also use RowMapper or BeanProprtyMapper of type POJO class as a return type while executing stored procedures using Spring’s SimpleJdbcCall API. I am also going to use @Qualifier annotation for resolving ambiguity while using SimpleJdbcCall with DataSource and…

Continue

MySQL Event Scheduler

This tutorial will show you how we can use MySQL Event Scheduler to schedule or automate some tasks periodically at a particular interval. MySQL Events are tasks that run according to a schedule. Therefore, it is sometimes referred to as scheduled events. When we create an event, we are creating a named database object containing one or more SQL statements to be executed at one or more regular intervals, beginning and ending at a specific date and time. For more information please go through http://dev.mysql.com/doc/refman/5.1/en/events.html

Continue

Find Path for Nested Categories in MySQL

Introduction This tutorial shows how to find the entire path from root to child for nested categories and subcategories. Let’s say you have a table in database in such a way it contains unlimited level of categories and you have another column in the same table which should contain the entire path for the nested categories. So you need to update the column that should contain the entire path for nested category and sub-category using Stored Procedure.

Continue

Select only one random item from each category in MySQL

This tutorial shows how to select items randomly from each category in MySQL. So here I will select exactly one item randomly from each category. People who need sometimes to select photo from each photo category and display them on the page for animation purpose will be benefited. In this example I have used two sample tables with data. You can change the name and column names as per your needs and you will get the same results.

Continue

Infinite dynamic Multi-level nested category with PHP and MySQL

Introduction I am going to show you how to build infinite dynamic multi level nested category with PHP and MySQL server. Here I will show example of infinite level of categories and subcategories on the fly from a MySQL database. So I am going to give an example on infinite multi level nested category with PHP and MySQL. Related Posts: Infinite dynamic Multi-level nested category with Codeigniter and MySQL

Continue

Create an effective pagination in PHP and MySQL

This tutorial shows how to create effective pagination in PHP and MySQL. When there are lots of data need to be shown on a page then the data grows at the bottom of the page hence the scroll appears. Most of the times it becomes very irritating to go to the bottom so pagination comes to rescue. Using pagination the navigation becomes effective and we don’t need to scroll the page at bottom. Using pagination we can go to the first page, nest page, previous page, last page and at…

Continue

Database connection example in PHP and MySQL

Introduction This tutorial shows database connection example in PHP and MySQL. Here we will create a PHP file with commonly used functions on how to connect to MySQL database using PHP. It is mandatory to establish database connection when you are working on a dynamic application. The database may be any one of your choice or according to the requirement of your application. Here I am going to use MySQL database to serve the purpose. I have used here mysqli_* function to show a database connection example in PHP and…

Continue