Wednesday, 29 February 2012

EXPLAIN keyword Usage in SQL

The SQL compiler can capture information about the access plan and environment of static or dynamic SQL statements. The captured information helps you understand how individual SQL statements are executed so that you can tune the statements and your database manager configuration to improve performance.

You collect and use explain data for the following reasons:
  • To understand how the database manager accesses tables and indexes to satisfy your query
  • To evaluate your performance-tuning actions
In Front Any SQL Query just Give EXPLAIN key word . That shows the following things .That Based On how many Table using





   

Friday, 17 February 2012

Setting Eclipse Memory Size

You working in eclipse means  some time that hangs.Because of not enough memory. Initially in eclipse.ini file memory is like this

-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx 512m

that depend on different Operating System.

        Among other things, this sets the heap space to 40MB initially and a maximum of 512MB, and also specifies a maximum PermGen size of 256MB.

        A max heap of 512MB might be OK for some users, but it's often necessary to bump that value up for large project sets or when some third-party plugins are installed.

      So You need  increase memory size 1024MB.It enough for users.Or you increase above 1024MB.




-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx "YOUR MEMORY SIZE HERE "m

If you increase memory then eclipse works fine.








Thursday, 16 February 2012

How To String Concatenation with Null values in SQL?

Normally If You concate One String Value With NULL values means  That Returns NULL value only or some time that Query result not came.To Prevent this by use of  "ISNULL(....)"   Statement.


Example:

      SELECT  CONCAT(ID,ISNULL(NAME,' '))  FROM TABLE_NAME WHERE CONDITION

In that  ISNULL checks  the  NAME .The  Value of NAME  is  NULL means replace Empty String and  concat with ID and return result.Otherwise it returns Actual value of NAME and concat with ID and return result.

   You Can also use "COALESCE" instead of  "ISNULL" .Both Doing Same action only.

It also Work in HQL.





    

Monday, 9 January 2012

How to retrive data's in Many-to-Many Relationship using Hql?

You Can Retrive all data in Many-To-Many Relationship Using the following join Query

Hbm File is Like these


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
     
<hibernate-mapping>

<joined-subclass entity-name="test"
                 table="TEST"  dynamic-update="true" dynamic-insert="true">

<key column="ID"/>

<property name="name" type="string" column="NAME" />

<set name="assistantName"
        table="TEST_1"
       inverse="false"
       lazy = "false"
       cascade="none"
       sort="unsorted">
       <key column="ID"/>
       <element column="ASSISTANTNAME"  type="string"/>
        </set>
</joined-subclass>
</hibernate-mapping>



Use Of Following Hql  join Query  Retrive Both Table data TEST and TEST_1


     
select
        fetchInfo.id as id,
        fetchInfo.name as name,
        Test_1.id as assistantName
from
         test as fetchInfo join fetchInfo.test_1 as Test_1
where
         fetchInfo.id =:someValue




Thursday, 22 December 2011

HOW TO HIDE AND UN HIDE FILES IN UBUNTU ?

 You can hide un hide any  Files or folders  using    "."  in ubuntu .
           Example:
                   File or Folder named like ' test '. You rename test as .test  and the file or folder
                   automatically  hide.
 If you want see the hidden files and folder means use 'ctrl+H'.It shows all Invisible files. 

 You need show the hidden files permanently  just remove "." infront of file or folder.



           
   

Sunday, 18 December 2011

Delete All .txt files in all subdirectories in ubuntu?

To use of Following command line You can delete all files named like .txt

    find /folder -type f -name "*.txt" -delete 




         Use of this command line you can  delete all file in sub directories named like ".txt". You can delete any  files by just by replacing file extension and put that your extension into your command line.
         "folder -type f" is the path where the folder is located




Wednesday, 14 December 2011

HOW CAN YOU GET LABEL FIELD OF ITEMSELECTOR BOX IN EXTJS?

Use of text() method you can get that exact label value in itemselector

    "  $('#id of that field').text() "