Monday, June 13, 2011

ORSIM 13.2.0

Oracle Retail Store Inventory Mangement 13.2.0

Sunday, February 13, 2011

What do you mean by Named – SQL query?

Named SQL queries are defined in the mapping xml document and called wherever required.

<sql-query name = "empdetails">
   <return alias="emp" class="com.test.Employee"/>
      SELECT emp.EMP_ID AS {emp.empid},
                 emp.EMP_ADDRESS AS {emp.address},
                 emp.EMP_NAME AS {emp.name} 
      FROM Employee EMP WHERE emp.NAME LIKE :name
</sql-query>

Invoke Named Query :
List people = session.getNamedQuery("empdetails")
       .setString("TomBrady", name)
       .setMaxResults(50)
       .list();

Steps in using verisign certificate with Glassfish appserver

1. Generate the key pair 
delete mykeystore.jks if already exists 
keytool -genkey -alias test-server -keysize 1024 -keyalg RSA -keystore mykeystore.jks -dname "CN=mytest.myorg.com, OU=MyGroup, O=My Org, L=MyCity, S=MyState, C=MyCountry" 
2. Generate the certificate request 
keytool -certreq -alias test-server -sigalg SHA1withRSA -keystore mykeystore.jks -file testserver.cer 
3. Sign the certificate with CA 
Goto www.verisign.com 
Try with Free Trial SSL --> 
cat testserver.cer and cut & paste in the certificate area. 
You may receive the mail with instructions. 
4. Import the replied certificate into keystore 
Save the given reply certificate (from your email) to a file, say - signed_test_server.cer and save verisign CA certs in files. I got 2 . One intermediate and another Test Trial CA (say copied to verisign_test_ca.cer and verisign_intermediate_ca.cer) . 
Import into mykeystore.jks (same keystore as used in the first step) and assume 
keytool -import -alias verisigncert -keystore mykeystore.jks -trustcacerts -file verisign_test_ca.cer -v 
keytool -import -alias verisigninter -keystore mykeystore.jks -trustcacerts -file verisign_intermediate_ca.cer 
keytool -import -alias test-server -keystore mykeystore.jks -trustcacerts -file signed_test_server.cer 
If the above steps were not correct, you may face certificate chain issue during import. 
Double check the subject and issuer of the certificate (test-server). [ keytool -list -keystore mykeystore.jks -alias test-server -v ] 
Now your server certificate is ready to use. 
In glassfish server environment: 
1. Add the SSL to http-listener-2 with "test-server" (same as above) alias using admin console . Stop the server. 
2. Copy mykeystore.jks to keystore.jks (under domain1/config) 
3. Import the CA certs in trust store (domain1/config/cacerts.jks): 
keytool -import -alias verisigncert -keystore cacerts.jks -trustcacerts -file verisign_test_ca.cer -v 
keytool -import -alias verisigninter -keystore cacerts.jks -trustcacerts -file verisign_intermediate_ca.cer 
4. Start the server 
At this point you should able to access https://localhost:8181/ with new test-server certificate. 
Tried to give you some level of information before I take more time in creating a doc and later I will have wiki page with screenshots. 
Hope this helps.

What Java Has Removed from C++...?




  • Java does not include structures or unions. These were felt to be redundant since the 
    class encompasses them.

  • Java does not support operator overloading. Operator overloading is sometimes a 
    source of ambiguity in a C++ program, and the Java design team felt that it causes 
    more trouble than benefit.

  • Java does not include a preprocessor nor does it support the preprocessor directives. 
    The preprocessor plays a less important role in C++ than it does in C. The designers 
    of Java felt that it was time to eliminate it entirely.

  • Java does not perform any automatic type conversions that result in a loss of 
    precision. For example, a conversion from long integer to integer must be explicitly 
    cast.

  • All the code in a Java program is encapsulated within one or more classes. Therefore, 
    Java does not have what you normally think of as global variables or global functions.

  • Java does not allow default arguments. In C++, you may specify a value that a 
    parameter will have when there is no argument corresponding to that parameter when 
    the function is invoked. This is not allowed in Java.

  • Java does not support the inheritance of multiple superclasses by a subclass.

  • Although Java supports constructors, it does not have destructors. It does, however, 
    add the finalize( ) function.

  • Java does not support typedef.

  • It is not possible to declare unsigned integers in Java.

  • Java does not allow the goto.

  • Java does not have the delete operator.

  • The << and >> in Java are not overloaded for I/O operations.

  • In Java, objects are passed by reference only. In C++, objects may be passed by 
    value or by reference.

  • Saturday, February 12, 2011

    How do I configure the configuration file..?

    The configuration file used is our old web.xml, if we use some IDE it will be pretty simple to generate but the contents will be something like below:



    <?xml version="e;1.0"e; encoding="e;UTF-8"e;?>
     
     <web-app version="e;2.4"e; xmlns="e;http://java.sun.com/xml/ns/j2ee"e; 
      xmlns:xsi="e;http://www.w3.org/2001/XMLSchema-instance"e; 
      xsi:schemaLocation="e;http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"e;>
        <context-param>
      <param-name>com.sun.faces.verifyObjects</param-name>
      <param-value>false</param-value>
        </context-param>
    
        <context-param>
      <param-name>com.sun.faces.validateXml</param-name>
      <param-value>true</param-value>
        </context-param>
    
        <context-param>
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>client</param-value>
        </context-param>
    
        <servlet>
      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
        </servlet>
    
        <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>/faces/*</url-pattern>
        </servlet-mapping>
    
        <session-config>
      <session-timeout>
         30
      </session-timeout>
        </session-config>
    
        <welcome-file-list>
          <welcome-file>
      index.jsp
          </welcome-file>
        </welcome-file-list>
     </web-app>

    How JSF different from conventional JSP / Servlet Model..?

    JSF much more plumbing that JSP developers have to implement by hand, such as page navigation and validation. One can think of JSP and servlets as the assembly language? under the hood of the high-level JSF framework.

    What is JSF architecture?

    JSF was developed using MVC (a.k.a Model View Controller) design pattern so that applications can be scaled better with greater maintainability. It is driven by Java Community Process (JCP) and has become a standard. The advantage of JSF is that it’s both a Java Web user – interface and a framework that fits well with the MVC. It provides clean separation between presentation and behavior. UI (a.k.a User Interface) can be created by page author using reusable UI components and business logic part can be implemented using managed beans.