Pages

Thursday, September 22, 2011

First hibernate program – helloworld

SoftWare Used 1. Eclipse 3.22. Razorsql (http://www.razorsql.com/)3 HsqlDB (http://hsqldb.org/)4 JDK 1.65 ant The following jar are requied to run the appication 1.hibernate3.jar2.antlr-2.7.6.jar3.javassist-3.9.0.GA.jar4.jta-1.1.jar5.dom4j-1.6.1.jar6.commons-collections-3.1.jar7.slf4j-api-1.5.8.jar8.slf4j-simple-1.5.2.jar9.hsqldb.jar Most of the jars will be available in hibernate binary distribution,...
Read more

clipboard copy and paste in flex web application

In flex we can easily save our data to System clipboard by using System.setClipboard() method. For security reasons getting clipboard data from flex code is not allowed.An alternate way to get the clipboard data to flex Application is through java script by ExternalInterface.call(). Once control was transferred to javaScript we can access the clipboard data and return it to flex Application. below is the attached codeCopyAndPaste.mxml!--[CDATA[import mx.controls.Alert;public...
Read more

EJB3 – Helloworld example using weblogic 10.3

It is sample EJB3 Program. It uses weblogic 10.3 server , jdk 1.6 and ant toolyou need the following jars to complie and run the EJB3 Applicationwlfullclient.jarjavax.ejb_3.0.1.jarweblogic.jarThe Ear file consisting of ejb was deployed in weblogic sevrer and it was invoked from a stand alone java client.Below are the steps to develop sample EJB3 application1.Create the directory structure and source...
Read more

Java Program--first stepp--hello world.

java – hello worldFirst Java ProgramFirst to Compile and run a java program you need a Java SE Development Kit . if you don’t have java SE Development Kit download and install from the above linkBelow are the steps to compile and run a java ProgramStep1.create a folder JavaProg. I have Created in D:\data\JavaProgStep2.Open a text file copy and paste the helloWorld program and save it as “helloWorld.java”...
Read more

java phonebook application

It Is a Simple Java Phone Book Application Created Using Eclipse IDE. In this the data are stored in the File System in the form of Objects. Below are the Steps to create and run the ApplicationStep 1 : Create a New Java Procject Named phoneBookApp in Eclipse. and then Create a new class phoneBook(java file) Click FinishStep2 : Create a file store.dat in D:/data/workspace/phoneBook/ Path Copy and Paste the below Prog in the “phoneBook. java” File import java...
Read more

Wednesday, February 9, 2011

Java Client - Server chat --- very Basic SOCKET PROGRAMMING

Compile both Programs and create clas filesOpen 2 cmd's .In one of thos enterjava serverand in otherjava clientserver.javaimport java.net.*;import java.io.*;public class server{public static void main(String [] ar){int port = 6666;try{ServerSocket ss=new ServerSocket(port);System.out.println("Waiting for a client....");Socket socket=ss.accept();System.out.println("Got a client...");System.out.println();InputStream sin=socket.getInputStream();OutputStream sout=socket.getOutputStream();DataInputStream...
Read more

Saturday, February 5, 2011

User Login in JSP

User Login in JSPEvery website and software in the world is having login facility. Login gives access rights to user and defines their role in website and application. Nobody can access website if they failure in proving their identity on website or application.Registration is first step by login to website. We will keep focus on only user login in JSP.User login contain two fields, first one important User ID. This is unique ID provided by site owner or software...
Read more