Friday 13 July 2012

How to Create Oracle WebLogic server domain

Step 1:

Open the WebLogic Domain Configuration Wizard by selecting
Start > All Programs > Oracle WebLogic > Configuration Wizard > Tools >ConfigurationWizard.



Step 2:

Create a domain based on WebLogic Server. (Accept the default that is presented), Click Next.

 
 

Step 3:

Name the domain satyamsoft. Choose the location, and then click Create to generate the domain.



Step 4:

Enter the login credentials to be used. Enter weblogic as the username and password.



Step 5:

Accept the defaults for Development Mode and the JDK (Sun SDK 1.6), and click Next.



Step 6:

Click next.



Step 7:

Click on Create button.



Step 8:

When finished, make sure that Start Admin Server is deselected and click Done.

How to create Connectionpooling in Oracle WebLogic Server

Step 1:

After login into the Weblogic Server in the left hand panel click on the Services > JDBC > Data Sources. In the middle panel select the check box of the your JNDI name, and then click on the name.



Step 2:

Click on the Connection Pool button.

 
 

Step 3:

Here the initial capacity default is 1. Next Maximum Capacity Default is 15. Next Capacity Increment default is 1 if u want to increase connections your wish. After that click on Save button.



Step 4:

Here you can observe message like All changes have been activated. Settings updated Successfully.

Create Jndi DataSource in WebLogic Server



Step 1:

First you need to start the server, for that open domain location folder that means at the time of creating domain name. Here our domain folder name is satyamsoft in that open bin folder and then double click on the startWeblogic batch file.



 Step 2:


After click on the batch file you can see status of the server in the console. In the end it shows the Running mode.

 

Step 3:

Open browser and then type http://localhost:7001/console. The default port number for WebLogic Administration Server is 7001. 

 

Step 4:

Select the DataSource under the Services->JDBC.

 

Step 5:

Click on the New button.


 


Step 6:

In the next step write give what would you like to name your new JDBC Data Source and in the JNDI Name give What JNDI name would you like to assign to your new JDBC Data source, next select the data base type then click on the Next.



Step 7:

Click on the Next button.



Step 8:

Give the database name what would you like to connect next Host name is localhost, Port is 1521 and then type Database username and password. click on the Next button.



Step 9:

For test click on the Test Configuration button.



Step 10:

Give the database name what would you like to connect next Host name is localhost, Port is 1521 and then type Database username and password. click on the Next button.



After completed you can use the JNDI name in your application for getting Database connection object. By using connection object you can insert,update,delete and retrive the data using database.

 

 

Thursday 12 July 2012

Create a datasource in websphere server

Step 1: To configure a Oracle DataSource, you first have to define a Oracle JDBC Provider. Open the application server administrative console and from the left-hand panel, choose Resources>JDBC Providers

   

 Step:2 Choose New to specify a new JDBC provider.


  Step 3: Select the database type as oracle, specify a provider type as Oracle JDBC Driver,implementation type as Connection pool data source and name is user defined name then click Next.




Step 4: Specify the path of the ojdbc6.jar or ojdbc14.jar file then click Next.

 

Step 5: In the next step u can see the summary of actions then click finish.


Step 6: Set Up the J2C Authentication Data

From the left-hand panel, choose Security>Global Security.

 

 

Step 7:

In the Configuration screen, under the Authentication section in the right column, expand the JAAS Configuration option, and choose the J2C Authentication data option.

 
 

Step 8:

In the J2C dialog, click the New button to create a new authentication data entry. Next step in the General Properties Alian name u can give any name, in the User Id give your oracle database user id and in the password give your oracle database password and then click apply and ok.

 

Step 9:

For creating Oracle Data Source from the left-hand panel, choose Resources>Data Sources.Choose New to specify a new Data Source, In the data source name option give any name and in the JNDI name give any name and then click next 

 

 

Step 10:

Under the Select JDBC provider select the Select an existing JDBC provider button in that you select the option of what you have mentioned in the JDBC Provider and then click next. 

 

Step 11:

 Here you should enter the URL of the oracle database(jdbc:oracle:thin:@localhost:1521:XE) and in the data store helper class name option select the version of the Oracle database what you have installed in your system and then click next

 

Step 12: 

For security aliases select the Component-managed authentication alias and Container-managed authentication alias and then click next

 

Step 13: 

Here you can see the summary of actions and then click finish.

 

Step 14:  

For test the Connection select name and click on Test connection button, in the same page up you can see the message like connection successful.

 

Steps for using the Oracle DataSource in your J2EE Application 

1). In web.xml file we have to write like

<resource-ref> <description>Datasource connection to db</description> <res-ref-name>jdbc/dbc</res-ref-name> <res-type>javax.sql.DataSource</res-type> </resource-ref>

 Here our Jndi name is SatyamSoft_Jndi. This name we should write in ibm-web-bnd.xml file in the <resource-ref> tag under the binding-name attribute and in the application DataSource dataSource = (DataSource)context.lookup("SatyamSoft_Jndi").

 

2). In ibm-web-bnd.xml file we have to write like

<virtual-ref name="default_host"/>
<resource-ref name="jdbc/dbc" binding-name="SatyamSoft_Jndi"/>

3). In your application mainly you should import the 

  • import javax.naming.Context;
  • import javax.naming.InitialContext;
  • import javax.sql.DataSource;
  • import java.io.*;
  • import javax.sql.*;
  •  

    4). Actually for getting database connection object we are mentioning the Driver name,URL,Username,Password. But now we can write like below

    • Context context = new InitialContext();
    • DataSource dataSource = (DataSource)context.lookup("SatyamSoft_Jndi");
    • Connection conn = dataSource.getConnection();

    After getting Connection Object we can retrive,insert update and delete the data Using the Oracle Database. 

    For Download ScreenShots Click here


    Wednesday 11 July 2012

    Dynamic Calculator

    Calculator



    How to install Maven on Windows

                              How to install Maven on Windows

    Apache Maven is not require to install on Windows as a service component, you just need to download the Maven’s zip file, extract it and configure the Windows environment path variable. See following steps :
    First we need to set the JAVA Path for use the Maven.

    1. Add JAVA_HOME

    Make sure you had installed JDK, and add a new “JAVA_HOME” into Windows environment variable, and point to your JDK folder.

    2. Download Apache Maven

    Download Apache Maven zip file from this official website, e.g apache-maven-3.0.4-bin.zip.

    3. Extract It

    Extract the downloaded zip file, for instance, "E:\apache-maven-3.0.4".


    4. Add MAVEN_HOME


    Now, add Maven folder "MAVEN_HOME" to Windows environment variable also.


    5. Add PATH

    Add the "Maven bin folder" into Windows environment variable, so that you can access Maven command everywhere.

    6. Verification

    Done, to verify it, in command prompt, type "mvn –version" to verify the installation detail.
    If you see similar message, means your Apache Maven is installed successful on Windows.

    Maven Tutorial

                                       Maven Tutorial 

    What is Maven?

    We need a standard way to build the projects, a clear definition of what the project consisted of, an easy way to publish project information and a way to share JARs across several projects.The result is a tool that can now be used for building and managing any Java-based project.The most powerful feature is able to download the project dependency libraries automatically.
    Maven is a project object model, a set of standards, a project lifecycle, a dependency management system, and logic for executing plugin goals at defined phases in a lifecycle. When you use Maven, you describe your project using a well-defined project object model, Maven can then apply cross-cutting logic from a set of shared plugins.

    Maven's Objectives

    Maven's primary goal is to allow a developer to comprehend the complete state of a development effort in the shortest period of time. In order to attain this goal there are several areas of concern that Maven attempts to deal with:
       >Allowing transparent migration to new features
       >Making the build process easy
       >Providing guidelines for best practices development
       >Providing a uniform build system
       >Providing quality project information