Posts

Showing posts from July, 2017

Improve performance of stored procedure

PL/SQL performance PL/SQL it self is used to improve the performance. In application, most of logic implemented in java having communication with database to perform database operations. Database operation from java code for more number of iteration is not a good practice. It is always advisable, if the database call are performed under large number of iteration then move that logic into PL/SQL and perform those logic there. Significant performance can be achieved by doing this. While doing code transforming from java code into PL/SQL, developer may face number of difficulties. Difficulty: Q. How to pass array of two , array of three from java to PL/SQL? Ans:- Oracle supports custom data types, where developer can create custom data type. The custom data type in the form of array of two ( i.e. pair of two strings / number ) , array of three ( triplate of  string / number ). Once those custom data type are defined in the oracle database then developer needs to form collection mat

No expectation,No Disappointment.

Expectation!Expectation!Expectation!Expectation! Every  body carries expectation in life at every stage. An individual being an child have expectation from parent, being friend have expectation best friend.Every body have expectations. What happens if the expectation are not met or not completed? lets take an example of individual being an child having expectation from parent. A child, till get matured would have expectation which are like :- #1 Parent should give a time to child. Now a days both parent works to have good life style and most important to close the home loan. Once the parent at work, child mostly kept a day care. A recent incidence, would like to share, where a child visited a family at downstairs where a kid was playing with grandmother. seeing that, child spoke to with grandmother and asked, you look after a kid daily? her mother wont kept her at Day Care. Daily my mother kept me at Day Care. I do not like that, my parent do not gives a time to me. I will als

Reverse String, Unchanged position of special characters.

Reverse a string keeping the position of special characters unchanged in reversed string. ex.          i/p -     a,b#d$e&d          o/p -     d,e#d$b&a Solution :- static boolean isAlphabet(char x) {         return (x >= 'A' && x <= 'Z' ) || (x >= 'a' && x <= 'z' );     }         public static void main(String[] args) {                 String s = "Ab,c,de!$";//a,b$c";         System.out.println("Original String:- " + s);         char[] str = s.toCharArray();         int l = 0;         int r = s.length() - 1;                 while (l<r) {             if(!isAlphabet(str[l])) {                 l++;             }else if(!isAlphabet(str[r])) {                 r--;             }else{                 char a = str[l];                 char b = str[r];                                 str[l] = b;                 str[r] = a;                                 l++;