How to get sql dump from mysql

How to get sql dump from mysql
Please follow these steps in order to take sql dump from mysql

You must have MySQL version more 5.6 (Chances of working with MySQL 5.5 is very low)

Steps:

  1. Start–>Run–>cmd (Run as Administrator)
  2. Copy your mysql path  (C:\……\mysql\bin)
  3. In command prompt, set path (cd  C:\……\mysql\bin )
  4. After setting path enter
    mysqldump -u (username) -p (databasename)>sqldump.sql
  5. When you run it, it will ask for password, enter your database password
  6. your sqldump will be created inside bin folder.

Read More

Autocomplete textbox in JSP with Database

Autocomplete textbox in JSP with Database
Autocomplete textbox in JSP with Database using Jquery. You can retrieve your data from database and make it as suggestions for autofill textbox in JSP.

Requirements:
Download jquery-ui.js,  jquery-1.10.2.js, jquery-ui.css

JSP Page:

 

Read More

Java Convert String to Date and Compare

Java Convert String to Date and Compare
Here is a code to convert Java String to date and compare with date field in MySQL table.
This conversion is done to make comparison easier with the date field in MySQL table, so i have not used Simple Date Format function. Using Simple date format you can change the format of date.
This code is tested in Netbeans.

MySQL Table:

Note: Insert sample date using mysql query, I have inserted a date: “insert into datecheck values(‘2015-08-20’)

convert.java

 

Java String to Date conversion and compare with date in mysql, java string to date, string to date conversion

 

Read More

Get all dates in a month using Java

Get all dates in a month using Java
A code to print list of all dates in a month using Java
This code is tested in Netbeans

 

Read More

Prepared Statement using Spring jdbcTemplate (Spring + MySQL)

Prepared Statement using Spring jdbcTemplate (Spring + MySQL)
Here is the code about how to use PreparedStatement in Spring using JDBCTemplate. This code is tested in Netbeans.

Student.java

Studentdao.java

applicationContext.xml

statementexec.java

 

Read More