About admin

Author Archive | admin

How to change Java Version in Linux?

In this article, you will see how to change default java version to latest version.Check the current version used on your system. [root@localhost /]# java -version Example Output java version “1.4.2″gij (GNU libgc) version 4.1.2 2008704 (Red Hat 1.4.2-48) If there are multiple versions of java, you can change the default version by executing following [...]

Continue Reading ... Comments { 0 }

Installing MySql Workbench in Fedora

In this article, you will see how to install and launch Mysql Workbench in Fedora 18 1. Change root user su – OR sudo -i 2. Install Remi repository ** Remi Dependency on Fedora 18 **rpm -Uvh http”//download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm** Fedora 18 **rpm -Uvh http://rpms.famillecollet.com/remi-release-18.rpm 3. Install MySql Workbench yum –enablerop=remi install mysql-workbench 4. Launching MySql Workbench [...]

Continue Reading ... Comments are closed

Logback Logging Example

In this article, you will see very basic logging using Logback. First create a new Java Project and configure it as Maven Project. For Reference, Click Here Add the following dependencies in pom.xml 1. Logback Configuration The following configuration generates simple logs on console.logback.xml 2. Logback in Java Program The following Java class is a [...]

Continue Reading ... Comments { 0 }

Limit WordPress Search To Post Titles

In this article, you will see how to limit your wordpress search to post titles only. WordPress version WordPress 3.5 Source Code $search .= “{$searchand}(($wpdb -> posts.post_title LIKE ‘{$n}{$term}{$n}’) OR ($wpdb -> posts.post_content LIKE ‘{$n}{$term}{$n}’))”; Remove the OR part (in bold) to make it specific to post title.$search .= “{$searchand}(($wpdb->posts.post_title LIKE ‘{$n}{$term}{$n}’))”; Source File Source [...]

Continue Reading ... Comments { 0 }

JDBC Introduction

The Java Database Connectivity (JDBC) API is the industry standard for database-independent connectivity between the Java programming language and a wide range of databases– SQL databases and other tabular data sources, such as spreadsheets or flat files. The JDBC API provides a call-level API for SQL-based database access. JDBC technology also provides a common base [...]

Continue Reading ... Comments { 0 }

Spring + Log4j + Maven Example

In this tutorial, I will show you how to integrate Spring 3 with Log4j. Tools and technologies used : Spring Log4j Maven Eclipse Following example demonstrates a simple Hello World web application using Spring MVC that will show logging message on Console. First create a new Dynamic Web Project and configure it as Maven Project. [...]

Continue Reading ... Comments { 2 }

Spring + Hibernate + MySql + Maven Example

In this tutorial, I will show you how to integrate Hibernate with Spring 3. Tools and technologies used : Hibernate Spring MySql Maven Eclipse First create a new Dynamic Web Project and configure it as Maven Project. For Reference, Click Here Add the following dependencies in pom.xml 1. Sql Script Use the following Sql Script [...]

Continue Reading ... Comments { 11 }

Next and Previous Links for same Category in WordPress

I created a category and call it “WordPress”. Then I created some posts and assign “WordPress” as category for the posts. Now I want the next/previous to be shown for the same category only. WordPress version WordPress 3.5 Arguments function previous_post_link($format=’« %link’, $link=’%title’, $in_same_cat = false, $excluded_categories = ”) You can change the in_same_cat to [...]

Continue Reading ... Comments { 0 }

Get URL Parameter Using Javascript

It is sometimes required to get the query parameters of an URL in JavaScript. So following example demonstrates how to get parameter value from a URL. Source Code

Continue Reading ... Comments { 0 }

Hibernate – @MappedSuperclass How to override column identifier

In this tutorial I will show how to override an attribute from mapped super class. 1. Sql Script Use the following Sql Script for creating table. 2. Pojo Now create GenericId and User Class as following.GenericId.java : an abstract class, annotated with @MappedSuperclass that have id column User.java : an @Entity class that extends the [...]

Continue Reading ... Comments { 1 }