Friday, 11 September 2009

How to increase java heap size in Eclipse?

Add following entries to  eclipse.ini file.Current eclipse.int contents given below

-vmargs
-Xms512m  [minimum memory ]
-Xmx1024m  [maximum memory]
-Duser.name=Thillakan Sabanayakam  [Eclipse uses you OS user name in the @author java doc tag for default ]


Contents
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
-clean
-framework
plugins\org.eclipse.osgi_3.4.3.R34x_v20081215-1030.jar
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms512m
-Xmx1024m
-Duser.name=Thillakan Sabanayakam

Explore process Information in unix

Each process has an entry in the /proc filesystem identified by its PID. The following are the important files in /proc directory:
  • pid/cmdline contains the command that was used to start the process (using null characters to separate the arguments).
  • /proc/pid/cwd contains a link to the current working directory of the process.
  • /proc/pid/environ contains a list of the environment variables that the process has available.
  • /proc/pid/exe contains a link to the program that is running in the process.
  • /proc/pid/fd/ is a directory containing a link to each of the files that the process has open.
  • /proc/pid/mem contains the memory contents of the process.
  • /proc/pid/stat contains process status information.
  • /proc/pid/statm contains process memory usage information. 
  • /proc/pid/lwp contains the threads running in the process with the process id

Commands :
ls -l /proc/pid/fd | wc -l
ls -l /proc/pid/lwp | wc -l

Thursday, 10 September 2009

How to insert single or double quote into Oracle DB?

 Using q-quote string syntax, It can be done

Example :

INSERT INTO T(test) 
values (q'[single's quote and "double" quotes]');

Monday, 7 September 2009

How To Override Hibernate Configuration Settings?

 The following code segment will override the some properties. [hibernate.connection.driver_class, hibernate.connection.url ,hibernate.connection.url, hibernate.connection.password]


    public static void createSessionFactory(String driverclass,String url, String username, String password, String configFile) throws HibernateException {
        if (sessionFactory != null) {
            sessionFactory.close();
        }
        Configuration cfg = new AnnotationConfiguration().addResource(configFile);
        cfg.configure(configFile);
        cfg.setProperty("hibernate.connection.driver_class", driverclass);
        cfg.setProperty("hibernate.connection.url", url);
        cfg.setProperty("hibernate.connection.url", username);
        cfg.setProperty("hibernate.connection.password", password); 
        sessionFactory = cfg.buildSessionFactory();
    }

       Hibernate configuration files properties used in following implementation.

    public static void createSessionFactory(String driverclass,String url, String username, String password, String configFile) throws HibernateException {
        if (sessionFactory != null) {
            sessionFactory.close();
        }
        Configuration cfg = new AnnotationConfiguration().addResource(configFile);     
        cfg.setProperty("hibernate.connection.driver_class", driverclass);
        cfg.setProperty("hibernate.connection.url", url);
        cfg.setProperty("hibernate.connection.url", username);
        cfg.setProperty("hibernate.connection.password", password); 
        cfg.configure(configFile);
        sessionFactory = cfg.buildSessionFactory();
    }

Thursday, 3 September 2009

How To Add Your Linkedin Profile Button To Your Blogger Blog

Check the following links..
http://smallworkarounds.blogspot.com/2008/11/adding-linkedin-button-to-blogger-or.html
http://salesittech.blogspot.com/2009/02/include-your-linkedin-button-in-blogger.html