Posts

Showing posts from 2017

Web Services

Web Services :- that is client server application which communicate over www using http/s. Type of web services :- soap and rest. soap works over xml media type and rest over different media types like jason, text ext.soap stands for simple object access protocol where as rest stand for representational state transfer. WSDL: It is a web service description language, which contains the machine readable operation details of soap web service. It is used to describe formal contract details such as messages, operations, binding and web service locations. JAX-WS : used to create soap web services.  JAX-RS : used to create rest full web services. REST Full web services :- it provides stateless web services. it does not require xml message or wsdl service. is is based on below principles #1  resources identification through url : resources are identified by uri using annotations i.e @PathParmas, @QueryParms #2 uniform interfaces: resources are manipulated using defined operations i.

Custom DataType in Oracle Database.

Oracle provides the predefined types which developer can use in the PL/SQL. Those types are like NUMBER, ARRAYOFNUMBERS, VARCHAR2 and many more.  Developer who consumes PL/SQL from JAVA can easily use those types in case of normal scenario. But consider a scenario where, developer want to send collections to PL/SQL, then how that would be possible. So, oracle have provided an option to create own custom types as per requirement and use that types in PL/SQL. That custom type support essay access to data types from JAVA and speed up execution and developer can achieve performance too. Syntax of creation of custom type:- #1 TABLEOF3STRINGS:- create or replace TYPE "TRIPLETOFSTRINGS" as object (field1 varchar2(20), field2 varchar2(20), field3 varchar2(20)); create or replace TYPE "TABLEOF3STRINGS" as table of TripletOfStrings; #2 Structure with number field:- create or replace TYPE "LINEITEM" as object ( item_name varchar2(30), quanti

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++;