MySql Backup and restore

May 28th, 2008

Here I will show you how to Backup your mysql database and later on restore your database if there is a fault or something something.

Backup tables
mysqldump -uroot -ppass21 –databases db1 db2 db3 > backup.sql
Read the rest of this entry »

Cewolf & JFreeChart chart Tooltip

May 17th, 2008

I was searching how to create chart using cewolf and jfreechart. And it took months to get to this with alot of searching and not understanding what to doBut I came up with a pretty cool tutorials and I pull over with it, starting with cewolf tutorial.

Requirement:

    Cewolf 1.0
    Glassfish (Im using glassfish) even you can work with tomcat don’t kill your self ;)

Read the rest of this entry »

Java get Primary Key from table

April 9th, 2008

How to get a primary key of a table

    Connection conn = ... //your connection
Statement st = conn.createStatement(); //create a statement for your connection
//the table you going to use is temp
st.executeUpdate("create table temp(id int,name varchar, PRIMARY KEY (id) );");
st.executeUpdate("insert into temp values (1,'nameValue')"); // for testing.
Read the rest of this entry »

Kate to execute external command

April 9th, 2008

1. With KATE on your screen, select Settings -> Configure Kate… from the
menu.

2. In the Configure Dialog box shown below, click External Tools in the left panel, then then click the New… button at the bottom.

3. Read the rest of this entry »

JFreeChart with Servlet

March 6th, 2008

Hi there!

The code below help you to display Jfreechart (Pie Chart) on the Servlet.

You dont need to save the image anywhere, just you need to put Read the rest of this entry »

vi: Find and ReplaceAll

January 22nd, 2008

Hi!

Let say you have a document call document1.txt, it has text like this
Read the rest of this entry »

adding permanent route

January 18th, 2008

Hi there!

I put it Simple straight forward:

Login as Super user: (su -)
Read the rest of this entry »

SimpleDateFormat: getting yesterday date

October 26th, 2007
public String getYesterdayDate() {

String DATE_FORMAT = "yyyyMMdd";
SimpleDateFormat sdf =
new SimpleDateFormat(DATE_FORMAT);
Calendar c1 = Calendar.getInstance(); // today
c1.add(Calendar.DAY_OF_MONTH, -1); //back one

return sdf.format(c1.getTime());
}

Crontab

September 30th, 2007

Definition
utility that let task automatically run in the background. i.e scheduling

How does it work

    Simple ASCII text file

Read the rest of this entry »

Extracting file using FTP (scheduling)

September 30th, 2007

Hi there!

This is the simple method to use when you want to extract file from the server.
Read the rest of this entry »