Posts

Showing posts from September, 2012

MySql: Give Root User Logon Permission From Any Host

Image
I have already updated about this in my previous  blog but that was from UI, In this tutorial You can do the same task from MySQL client itself. To configure this feature, you’ll need to update the mysql user table to allow access from any remote host, using the % wildcard. Open the command-line mysql client on the server using the root account. Then you will want to run the following two commands, to see what the root user host is set to already: use mysql; select host, user from user; Here’s an example of the output on my database. mysql> use mysql; Database changed mysql> select host,user from user; +-----------+------+ | host      | user | +-----------+------+ | localhost        | root | | 127.0.0.1 | root | | ::1       | root | | localhost |      | +-----------+------+ 4 rows in set (0.07 sec) Now I’ll update the localhost host to use the w...

Liquibase Tutorial

What is Liquibase ? LiquiBase — available since 2006 — is an open source, freely available tool for migrating from one database version to another, It is an open source database-independent library for tracking, managing and applying database changes. A handful of other open source database-migration tools are on the scene as well, including openDBcopy and dbdeploy. LiquiBase supports 10 database types, including DB2, Apache Derby, MySQL, PostgreSQL, Oracle, Microsoft® SQL Server, Sybase, and HSQL. All changes to the database are stored in XML files and identified by a combination of an "id" and "author" tag as well as the name of the file itself. A list of all applied changes is stored in each database which is consulted on all database updates to determine what new changes need to be applied. LiquiBase executes changes based on this XML file to handle different revisions of database structures and data. When you first ...

How to get Current Thread Example

/*         This Java example shows how to get reference of current thread using         currentThread method of Java Thread class. */   public class GetCurrentThread {           public static void main ( String [ ] args ) {                                 /*                  * To get the reference of currently running thread, use                  * Thread currentThread() method of Thread class.                  *                  * This is a static method.                  */                         ...

Should Logger members of a class be declared as static?

Advantages for declaring loggers as static Disadvantages for declaring loggers as static common and well-established idiom less CPU overhead: loggers are retrieved and assigned only once, at hosting class initialization less memory overhead: logger declaration will consume one reference per class For libraries shared between applications, not possible to take advantage of repository selectors. It should be noted that if the SLF4J binding and the underlying API ships with each application (not shared between applications), then each application will still have its own logging environment. not IOC-friendly Advantages for declaring loggers as instance variables Disadvantages for d...

How to get directory size in linux ?

 du -sm <dir_name>