Skip to main content

Posts

What is UUID ? and Where its used ?

This article is regarding UUID and where it is used. The UUID is generated using a cryptographically strong pseudo random number generator. It is belongs to the package java.util. It is used to generate random number which is stronger and there wont be any  repetition of number.  UUID can be used for Creating random file names, Maintaining different Session id in web application. Transaction id in Banking sector. Primary key in Database. public static void man(String[] args) { UUID uniqueId = UUID . randomUUID ( ) ; System . out . println ( "The unique id is" + uniqueId . toString ( ) ) ; }
Recent posts

What is the difference between Abstraction and Encapsulation?

I'm sure You came here to see the answer after vising plenty of websites and which is not enough to understand about that concept. The reason why you cant get the perfect or believable answer abut this concept is you're not reading the whole content slowly and carefully. But im sure if you read this fully and carefully, you can earn the knowledge about the difference between Abstraction and Encapsulation. and here we are gonna teach you the real time scenario of Abstraction and Encapsulation. ok!  Lets go to the Topic. What is Abstraction: "Abstraction  is a process of hiding the implementation details and showing only functionality to the user." You could see this answer in many websites. Let me explain about what is implementation and functionality.  For Example, " Dhoni is a cool captain" Cool is his nature it is his Function. He is always cool even the Team is in underpressure. So cool is his Natural Function. And, We dont know how he is so cool in under

Standardization of Method Signature

Today i would like to convey some of standards which most of it companies follows. Method signature which is not suppose to get changed when ever each parameter of a method is removed or added. If so we have to change all the code which uses this method. So its better to pass HashMap instead of passing each and every parameter. Example: public void addUser(int empid,String passcode,String addressStandardization of Method Signature,int mobileNumber) Consider addUser method is used to process user data. In future if we want to add some parameter to addUser method we need to change all the code which uses the method addUser so it is better to send HashMap instead of sending all data seperately HashMap hm = new HashMap() ; hm.put("empid","id") ; hm.put("passcode","***") ; hm.put("address","____") ; hm.put("mobileNumber","000000000") ; public void addUser(HashMap data) { int id = Integer . parseInt ( data .

Responsive PanelGrid in JSF Primeface

Here, we are going to learn about responsive PanelGrid in JSF Primeface component. As we know primefaces providing lots of good stuffs for JSF. In Primeface, there is a component name Panel Grid which we are going to use for our convenience. In most of the cases, PanelGrid used for making our content in a proper way. If users opens our website which we have made in jsf using panelGrid component that not in responsive manner, that could be really ugly as for as user concern, So here we are going to break it just by using Layout attribute in the panel Grid component. for exaple, < h3 >Responsive</ h3 > < p:panelGrid columns = "3" layout = "grid" >                 < h:outputText value = "Content" />      < h:outputText value = "Content" />      < h:outputText value = "Content" />      < h:outputText value = "Content" />      < h:outputText value = "Content" />

Varchar(-1)

Today we are going to discuss about the varchar(-1). why we are using varchar(-1) and what is the purpose of it. Varchar(-1) In case if we user doesnt know the column length. how many character will user enter: so it is better to go with vachar(-1) Consider the column address is of varchar(-1), now in case 1 when user enter a data of size varchar(10) the size of the column dynamically accepts the user data of size varchar 10. later in case 2 user tries to insert data of size varchar 100. now the column address can accept user data of size 100.  NOTE: The size of the column will change automatically when user tries to insert a data of size greater than previous inserted data.

How to clear Filter value in Primefaces Datatable?

As we Know, primefaces provides plenty of components for JSF. In this discussion, we are going to uncover filter attribute mystery in Datatable. Above the pic represents the filter option which is available in primeface . we can easily inherit filter option to datatable. PROBLEM WE FACE: while doing filter in datatable primeface, if we want to go further action. for example, you have 1000 of records, you're filtering option to filter those records. while filtering, you have seen your records and you need to go another action, at the time filter wont be clear. it will be remains same. Inorder to overcome that issue, we need to use below scripts, RequestContext.getCurrentInstance().execute("PF('any_name').clearFilters()"); Add widgetwar attribute in your datatable component <p:datatable id="d_id"   widgetVar ="any_name">

Difference between Lock and Nolock

Lock Lock in  MSSQL is used to prevent concurrent access of tables. It is widely used to application that have large number of users who access database. In case if a user tries to alter a table the table will be in lock state so that no other user can try to alter the table until the lock release.  In this case User 1 is trying to alter the table in database. User 2 has to wait until the lock is released by user 1. After that User 2 will put lock and execute the query. In case if user fails to use lock it will results in error Note: Lock is used in DML statement. Nolock  Nolock is used so that two or more user can access the table simultaneously.It widely used in DDL statement.    This is many number of user can select (View) data from table. select statement is similar to read. Where as DML is similar to write. By using nolock the data retrieval speed is increased for the user. There is no need wait until other user data selection ends.