Thursday, September 6, 2007

Trap Browser Close Button

// Tracking of Browser Close Button



Tuesday, May 1, 2007

DATABASE connectivity in JAVA using JDBC Driver

Different Typs of Driver Available in JAVA

Type 1: JDBC-ODBC Bridge

The type 1 driver, JDBC-ODBC Bridge , translates all JDBC calls into ODBC (Open DataBase Connectivity) calls and sends them to the ODBC driver. As such, the ODBC driver, as well as, in many cases, the client database code, must be present on the client machine.

Java--->JDBCStat-->JDBC-ODBC bridge-->ODBC-->Databases

Type 2: Native-API/partly Java driver

JDBC driver type 2 -- the native-API/partly Java driver -- converts JDBC calls into database-specific calls for databases such as SQL Server, Informix, Oracle, or Sybase. The type 2 driver communicates directly with the database server; therefore it requires that some binary code be present on the client machine.

Type 3: Net-protocol/ all-Java driver

JDBC driver type 3 -- the net-protocol/ all-Java driver -- follows a three-tiered approach whereby the JDBC database requests are passed through the network to the middle-tier server. The middle-tier server then translates the request (directly or indirectly) to the database-specific native-connectivity interface to further the request to the database server. If the middle-tier server is written in Java, it can use a type 1 or type 2 JDBC driver to do this.

Java-->JDBC statements-->SQLStatements- -> databases.

Type 4 Pure Java Driver

Type 4 JDBC drivers are direct-to-database pure Java drivers ("thin" drivers). A Type 4 driver takes JDBC calls and translates them into the network protocol (proprietary protocol) used directly by the DBMS. Thus, client machines or application servers can make direct calls to the DBMS server. Each DBMS requires its own Type 4 driver; therefore, there are more drivers to manage in a heterogeneous computing environment, but this is outweighed by the fact that Type 4 drivers provide faster performance and direct access to DBMS features.

Examples J

// Class.forName("sun.jdbc.odbc. JdbcOdbcDriver");//for MS Access
//con = DriverManager. getConnection("jdbc:odbc:dataSourc eName");//for Ms Access TYPE1


//Class.forName("sun.jdbc.odbc. JdbcOdbcDriver");//for SQL Server
//con=DriverManager .getConnection("jdbc:odbc:dataSourc eName","username","password");//for sQL Server TYPE1


Class.forName("com.microsoft. jdbc.sqlserver. SQLServerDriver"); //usign SQL SERVER 2K JDBC Driver
con=DriverManager. getConnection("jdbc:microsoft: sqlserver: //localhost: 1433;databaseNam e=dataSourceName ;selectMethod= cursor;","username","password");
TYPE 2

//Class.forName("net.avenir.jdbc2. Driver"); //atinav 2.5 JDBC driver(www.atinav. com:-30 days trial version jdm)
//con=DriverManager .getConnection("jdbc:AvenirDriver: //localhost: 1433/dataSourceN ame","username","password");
TYPE 3

//Class.forName("com.jnetdirect. jsql.JSQLDriver"); //JSQLConnect JDBC driver(http://www.j- netdirect. com/DownloadSoft ware.html: -30 days trial version )
//con=DriverManager .getConnection("jdbc:JSQLConnect: //localhost/ dataSourceName","username","password");
TYPE 3

//Class.forName("com.mysql.jdbc. Driver");// for mySQL
//con = DriverManager. getConnection("jdbc:mysql:/ /localhost/ dataSourceName? user=username&password=password");// need to download MySQL Connector/J

TYPE 4 because mysql connector is a type 4 driver

Thursday, April 19, 2007

class.Forename

Why We do not create Object of Class.forename();


What is Class class

It is a Class of declared class type.
Not have any public constructor, so due to this we can not create object of any class . and forName() is a static method, so it will cal with the help of class. This forName method take fully qualified class path which we want to execute at initialised time with the help of class loader.

java.lang Class Classjava.lang.Object
java.lang.Class
All Implemented Interfaces:
Serializable
public final class Class
extends Object
implements SerializableInstances of the class Class represent classes and interfaces in a running Java application.

Class has no public constructor. Instead Class objects are constructed automatically by the Java Virtual Machine as classes are loaded and by calls to the defineClass method in the class loader.

Tuesday, April 10, 2007

25 Tip For Job Search

25 TIPS FOR USING THE INTERNET IN YOUR JOB SEARCH

1. When typing your resume out with the intent of emailing, make sure it is in an ASCIIformat.

2. Use keywords heavily in the introduction of the resume, not at the end.

3. Keywords are almost always nouns, related to skills, such as financial analysis, marketing,accounting, or Web design.

4. When sending your resume via email in an ASCII format, attach (if you can) a nicely formattedone in case it does go through and the reader would like to see your creativityand preferred layout. If you do attach it, use a common program like MS Word.

5. Don’t focus on an objective in the introduction of the resume, but rather accomplishments,using keywords to describe them.

6. Don’t post your resume to your own Web site unless it is a very slick page. A poorlyexecuted Web page is more damaging than none at all.

7. Before you email your resume, experiment sending it to yourself and to a friend as a testdrive.

8. Look up the Web site of the company you are targeting to get recent news informationabout new products, etc., and look for their job posting for new information.

9. Before your interview or verbal contact, research the company’s Web site.

10. Use a font size between 10 and 14 point, make it all the same for an ASCII format resume,and don’t create your resume for emailing with lines exceeding 65 characters.

11. In case your resume may be scanned, use white paper with no borders and no creativefonts.

12. Include your email address on your resume and cover letter.

13. Don’t email from your current employer’s IP network.

14. Don’t circulate your work email address for job search purposes.

15. In the “subject” of your email (just below the “address to” part), put something morecreative than “Resume Enclosed.” Try “Resume showing 8 years in telecommunicationsindustry” (if that is your chosen industry), for example.

16. For additional sources of online job searching, do a “search” on the Web for job searching,your company, and your specific discipline for additional information.

17. Be careful of your spelling on the Internet. You will notice more spelling errors on emailexchanges than you will ever see in mailed letter exchanges.

18. Try to make sure your resume is scannable. This means it has a simple font, no borders,no creative lining, no bold face, no underlining, no italics, and limited if any columning.Though the practice of scanning is overestimated, it should still be a consideration.

19. Purchase or check out of a library an Internet directory listing the many links to job opportunitiesout there. There are thousands.

20. If you are using the email as your cover letter, keep it brief. If the reader is reading onscreen, their tolerance for reading long information is reduced dramatically.

21. Always back up what you can on a disk.

22. If you post your resume to a newsgroup, first make sure that this is acceptable to avoidany problems with other participants.

23. Remember that tabs and spaces are the only formatting you can do in ASCII.

24. Make sure you check your email every day. If you are communicating via the Internet,people may expect a prompt return.

25. Don’t send multiple emails to ensure that one gets through. Try to send it with aconfirmation of receipt, or keep a look out for a notice from you ISP that the messagedidn’t go through.

Wednesday, March 14, 2007

Socket MyClient;

MyClient = new Socket("Machine name", PortNumber);


Socket MyClient;

try {

MyClient = new Socket("Machine name", PortNumber);

}

catch (IOException e) {

System.out.println(e);

}


ServerSocket MyService;

try {

MyServerice = new ServerSocket(PortNumber);

}

catch (IOException e) {

System.out.println(e);

}


Socket clientSocket = null;

try {

serviceSocket = MyService.accept();

}

catch (IOException e) {

System.out.println(e);

}


DataInputStream input;

try {

input = new DataInputStream(MyClient.getInputStream());

}

catch (IOException e) {

System.out.println(e);

}


DataInputStream input;

try {

input = new DataInputStream(serviceSocket.getInputStream());

}

catch (IOException e) {

System.out.println(e);

}


PrintStream output;

try {

output = new PrintStream(MyClient.getOutputStream());

}

catch (IOException e) {

System.out.println(e);

}

DataOutputStream output;

try {

output = new DataOutputStream(MyClient.getOutputStream());

}

catch (IOException e) {

System.out.println(e);

}

PrintStream output;

try {

output = new PrintStream(serviceSocket.getOutputStream());

}

catch (IOException e) {

System.out.println(e);

}

try {

output.close();

input.close();

MyClient.close();

}

catch (IOException e) {

System.out.println(e);

}

try {

output.close();

input.close();

serviceSocket.close();

MyService.close();

}

catch (IOException e) {

System.out.println(e);

}


Socket programming

Tuesday, March 13, 2007

Any Type of Code help

provide help for JAVA, Javascript code , Struts.

Important library

Global Tech Soft Solution

Smart software solution.

Webdesigning, software Development & Consultant GlobalTech Soft Solution