<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3513789510947098583</id><updated>2011-11-27T15:53:38.231-08:00</updated><title type='text'>Learn java</title><subtitle type='html'>Learn java via this great blog....
java--
learn java,play java, enjoy java, earn with java...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://learningjava-aman.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://learningjava-aman.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Aman</name><uri>http://www.blogger.com/profile/03773653410891253027</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_diNGa3MkxCw/SqcDfOOm22I/AAAAAAAAAFI/-tCtENbzY0s/S220/aman+surat+(101).JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3513789510947098583.post-521632041230763664</id><published>2009-10-25T20:44:00.000-07:00</published><updated>2009-10-25T20:55:49.159-07:00</updated><title type='text'>Classes in  Java</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-size: medium; "&gt;&lt;img src="http://www.cs.vu.nl/~eliens/multimedia/@archive/vrml-reference/@documents/java/tutorial/images/shoeline2.GIF" align="BOTTOM" border="0" width="202" height="25" naturalsizeflag="3" /&gt; &lt;img src="http://www.cs.vu.nl/~eliens/multimedia/@archive/vrml-reference/@documents/java/tutorial/images/shoeline2.GIF" align="BOTTOM" border="0" width="202" height="25" naturalsizeflag="3" /&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'Times New Roman';"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'Times New Roman';"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span class="Apple-style-span"  style="color:#CC0000;"&gt;JAVA CLASS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'Times New Roman';"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 75, 81); font-family: verdana, arial, sans-serif; font-size: 10px; "&gt;&lt;p style="margin-top: 10px; margin-right: 10px; margin-bottom: 0px; margin-left: 0px; font-size: 13px; font-weight: normal; color: rgb(62, 92, 118); text-align: left; "&gt;A Java class is a group of &lt;a href="http://www.tech-faq.com/java-method.shtml" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Java methods&lt;/a&gt; and &lt;a href="http://www.tech-faq.com/java-variable-naming.shtml" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;variables&lt;/a&gt;.&lt;/p&gt;&lt;table border="0" align="right" cellspacing="0" cellpadding="0" width="310" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 12px; "&gt;&lt;tbody style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;tr style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;td style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 10px; margin-bottom: 0px; margin-left: 0px; font-size: 13px; font-weight: normal; color: rgb(62, 92, 118); text-align: left; "&gt;Each &lt;a href="http://www.tech-faq.com/java-source-code.shtml" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Java source code file&lt;/a&gt; can contain &lt;i style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;one&lt;/i&gt; public class. The name of this public class must match the name of the &lt;a href="http://www.tech-faq.com/java-source-code.shtml" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Java source code file&lt;/a&gt;. If the public class is called "ballistics", then the filename would be "ballistics.java".&lt;/p&gt;&lt;h2 style="margin-top: 30px; margin-right: 10px; margin-bottom: 0px; margin-left: 0px; font-size: 21px; font-weight: normal; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(158, 176, 181); "&gt;A sample Java class&lt;/h2&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 13px; "&gt;class Ammunition { int diameter; int length; String name; }&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3513789510947098583-521632041230763664?l=learningjava-aman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningjava-aman.blogspot.com/feeds/521632041230763664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningjava-aman.blogspot.com/2009/10/classes-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/521632041230763664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/521632041230763664'/><link rel='alternate' type='text/html' href='http://learningjava-aman.blogspot.com/2009/10/classes-in-java.html' title='Classes in  Java'/><author><name>Aman</name><uri>http://www.blogger.com/profile/03773653410891253027</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_diNGa3MkxCw/SqcDfOOm22I/AAAAAAAAAFI/-tCtENbzY0s/S220/aman+surat+(101).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3513789510947098583.post-1022598213999729488</id><published>2009-10-12T01:39:00.001-07:00</published><updated>2009-10-12T01:39:52.425-07:00</updated><title type='text'>Learn JAVA</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: 13px; line-height: 19px; "&gt;&lt;h3 class="post-title entry-title" style="margin-top: 0px; font: normal normal bold 130%/normal 'Lucida Grande', 'Trebuchet MS'; letter-spacing: -1px; color: rgb(255, 102, 51); "&gt;&lt;br /&gt;&lt;/h3&gt;&lt;div class="post-header-line-1"&gt;&lt;/div&gt;&lt;div class="post-body entry-content"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_diNGa3MkxCw/SqKFNWf_ltI/AAAAAAAAAE0/8gdphtqDA44/s1600-h/java.jpg" style="color: rgb(102, 153, 204); "&gt;&lt;img src="http://1.bp.blogspot.com/_diNGa3MkxCw/SqKFNWf_ltI/AAAAAAAAAE0/8gdphtqDA44/s320/java.jpg" alt="" id="BLOGGER_PHOTO_ID_5378007369458357970" border="0" style="border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-width: initial; border-color: initial; border-width: initial; border-color: initial; padding-top: 6px; padding-right: 6px; padding-bottom: 6px; padding-left: 6px; border-top-width: 1px; border-top-color: rgb(221, 221, 221); border-left-width: 1px; border-left-color: rgb(221, 221, 221); border-bottom-width: 1px; border-bottom-color: rgb(192, 192, 192); border-right-width: 1px; border-right-color: rgb(192, 192, 192); margin-top: 0pt; margin-right: 10px; margin-bottom: 10px; margin-left: 0pt; float: left; cursor: pointer; width: 181px; height: 165px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p style="font-family: arial; "&gt;&lt;b&gt;Java&lt;/b&gt; &lt;span style="color: rgb(0, 0, 153); "&gt;is a &lt;/span&gt;&lt;span style="color: rgb(0, 0, 153); "&gt;programming language originally developed by &lt;/span&gt;&lt;span style="color: rgb(0, 0, 153); "&gt;James Gosling&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153); "&gt; a&lt;/span&gt;&lt;span&gt;&lt;span&gt;t Sun Microsystems&lt;/span&gt;&lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/Sun_Microsystems" title="Sun Microsystems" style="color: rgb(0, 0, 153); "&gt;&lt;/a&gt;&lt;span style="color: rgb(0, 0, 153); "&gt; and released in 1995 as a core component of Sun Microsystems' &lt;/span&gt;&lt;span style="color: rgb(0, 0, 153); "&gt;Java platform.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style="margin-top: 0px; font: normal normal bold 130%/normal 'Lucida Grande', 'Trebuchet MS'; letter-spacing: -1px; color: rgb(204, 0, 0); "&gt;The Java Programming Language&lt;/h3&gt;&lt;p style="color: rgb(0, 0, 0); "&gt;The Java programming language is a high-level language that can be characterized by all of the following buzzwords:&lt;/p&gt;&lt;table style="width: 589px; height: 145px; color: rgb(0, 0, 0); "&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;li style="list-style-type: none; list-style-position: initial; list-style-image: initial; padding-left: 14px; margin-bottom: 3px; background-image: url(http://www.blogblog.com/tictac/tictac_orange.gif); background-repeat: no-repeat; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: 0% 6px; "&gt;Simple&lt;/li&gt;&lt;/td&gt;&lt;td style="vertical-align: top; "&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;li style="list-style-type: none; list-style-position: initial; list-style-image: initial; padding-left: 14px; margin-bottom: 3px; background-image: url(http://www.blogblog.com/tictac/tictac_orange.gif); background-repeat: no-repeat; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: 0% 6px; "&gt;Architecture neutral&lt;/li&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;li style="list-style-type: none; list-style-position: initial; list-style-image: initial; padding-left: 14px; margin-bottom: 3px; background-image: url(http://www.blogblog.com/tictac/tictac_orange.gif); background-repeat: no-repeat; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: 0% 6px; "&gt;Object oriented&lt;/li&gt;&lt;/td&gt;&lt;td style="vertical-align: top; "&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;li style="list-style-type: none; list-style-position: initial; list-style-image: initial; padding-left: 14px; margin-bottom: 3px; background-image: url(http://www.blogblog.com/tictac/tictac_orange.gif); background-repeat: no-repeat; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: 0% 6px; "&gt;Portable&lt;/li&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;li style="list-style-type: none; list-style-position: initial; list-style-image: initial; padding-left: 14px; margin-bottom: 3px; background-image: url(http://www.blogblog.com/tictac/tictac_orange.gif); background-repeat: no-repeat; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: 0% 6px; "&gt;Distributed&lt;/li&gt;&lt;/td&gt;&lt;td style="vertical-align: top; "&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;li style="list-style-type: none; list-style-position: initial; list-style-image: initial; padding-left: 14px; margin-bottom: 3px; background-image: url(http://www.blogblog.com/tictac/tictac_orange.gif); background-repeat: no-repeat; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: 0% 6px; "&gt;High performance&lt;/li&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;li style="list-style-type: none; list-style-position: initial; list-style-image: initial; padding-left: 14px; margin-bottom: 3px; background-image: url(http://www.blogblog.com/tictac/tictac_orange.gif); background-repeat: no-repeat; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: 0% 6px; "&gt;Multithreaded&lt;/li&gt;&lt;/td&gt;&lt;td style="vertical-align: top; "&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;li style="list-style-type: none; list-style-position: initial; list-style-image: initial; padding-left: 14px; margin-bottom: 3px; background-image: url(http://www.blogblog.com/tictac/tictac_orange.gif); background-repeat: no-repeat; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: 0% 6px; "&gt;Robust&lt;/li&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;li style="list-style-type: none; list-style-position: initial; list-style-image: initial; padding-left: 14px; margin-bottom: 3px; background-image: url(http://www.blogblog.com/tictac/tictac_orange.gif); background-repeat: no-repeat; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: 0% 6px; "&gt;Dynamic&lt;/li&gt;&lt;/td&gt;&lt;td style="vertical-align: top; "&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;li style="list-style-type: none; list-style-position: initial; list-style-image: initial; padding-left: 14px; margin-bottom: 3px; background-image: url(http://www.blogblog.com/tictac/tictac_orange.gif); background-repeat: no-repeat; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: 0% 6px; "&gt;Secure&lt;/li&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;p style="font-family: arial; color: rgb(0, 0, 0); "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); "&gt;In the Java programming language, all source code is first written in plain text files ending with the &lt;code style="color: rgb(255, 102, 51); "&gt;.java&lt;/code&gt; extension. Those source files are then compiled into &lt;code style="color: rgb(255, 102, 51); "&gt;.class&lt;/code&gt; files by the &lt;code style="color: rgb(255, 102, 51); "&gt;javac&lt;/code&gt; compiler. A&lt;code style="color: rgb(255, 102, 51); "&gt;.class&lt;/code&gt; file does not contain code that is native to your processor; it instead contains &lt;em&gt;bytecodes&lt;/em&gt; — the machine language of the Java Virtual Machine(Java VM). The &lt;code style="color: rgb(255, 102, 51); "&gt;java&lt;/code&gt; launcher tool then runs your application with an instance of the Java Virtual Machine.&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); "&gt;&lt;/p&gt;&lt;center style="color: rgb(0, 0, 0); "&gt;&lt;p&gt;&lt;img src="http://java.sun.com/docs/books/tutorial/figures/getStarted/g1.gif" alt="Figure showing MyProgram.java, compiler, MyProgram.class, Java VM, and My Program running on a computer." align="bottom" height="83" width="482" style="border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-width: initial; border-color: initial; padding-top: 6px; padding-right: 6px; padding-bottom: 6px; padding-left: 6px; border-top-width: 1px; border-top-color: rgb(221, 221, 221); border-left-width: 1px; border-left-color: rgb(221, 221, 221); border-bottom-width: 1px; border-bottom-color: rgb(192, 192, 192); border-right-width: 1px; border-right-color: rgb(192, 192, 192); " /&gt;&lt;/p&gt;&lt;p class="FigureCaption"&gt;An overview of the software development process.&lt;/p&gt;&lt;/center&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3513789510947098583-1022598213999729488?l=learningjava-aman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningjava-aman.blogspot.com/feeds/1022598213999729488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningjava-aman.blogspot.com/2009/10/learn-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/1022598213999729488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/1022598213999729488'/><link rel='alternate' type='text/html' href='http://learningjava-aman.blogspot.com/2009/10/learn-java.html' title='Learn JAVA'/><author><name>Aman</name><uri>http://www.blogger.com/profile/03773653410891253027</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_diNGa3MkxCw/SqcDfOOm22I/AAAAAAAAAFI/-tCtENbzY0s/S220/aman+surat+(101).JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_diNGa3MkxCw/SqKFNWf_ltI/AAAAAAAAAE0/8gdphtqDA44/s72-c/java.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3513789510947098583.post-4266753350455501943</id><published>2009-10-12T01:00:00.000-07:00</published><updated>2009-10-12T20:04:57.069-07:00</updated><title type='text'>Java applet</title><content type='html'>&lt;span class="Apple-style-span"   style="  line-height: 19px; font-family:sans-serif;font-size:13px;"&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;&lt;/p&gt;&lt;span class="Apple-style-span"  style=" line-height: 22px; font-family:Verdana, Arial, Helvetica;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  font-weight: normal; line-height: 19px; font-family:sans-serif;font-size:13px;"&gt;&lt;span&gt;&lt;span&gt;A Java applet is an applet delivered to the users in the form of Java bytecode. Java applets can run in a Web browser using a Java Virtual Machine(JVM), or in Sun's AppletViewer, a stand-alone tool for testing applets. Java applets were introduced in the first version of the Java language in 1995. Java applets are usually written in the Java programming language but they can also be written in other languages that compile to Java bytecode such as Jython or Eiffel&lt;/span&gt;&lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/Eiffel_(programming_language)" title="Eiffel (programming language)" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: initial initial; "&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Applets Structure&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;- There is no main method.&lt;br /&gt;- Two methods that are called automatically- init() and paint()&lt;br /&gt;- The init method initializes variables and objects; if you don't have one you will inherit one from the JApplet class.&lt;br /&gt;- Use paint to draw screen&lt;br /&gt;- A lot of methods exist in JApplet class so the "extends" keyword inherits everything that the class has. In the above example JApplet is parent class and shellapplet is the subclass so use the keyword "extends" to create inheritance.&lt;br /&gt;- You have to import JApplet and java.awt.Graphics (abstract windowing toolkit) to get Graphics to paint.&lt;br /&gt;- All applets must inherit JApplet&lt;br /&gt;- Use the "super" keyword in subclass to invoke method in the superclass.&lt;br /&gt;- super.paint( g ); this says uses the paint method from JApplet in my paint class and I'm not adding anything to it.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Example of Applet&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"   style="  font-weight: normal; font-family:'Times New Roman';font-size:medium;"&gt;&lt;pre&gt;/*   Java applet to demonstrate the use of classes.  This is the exmample from Chapter 10 of Bell &amp;amp; Parr */  import java.awt.*; import java.applet.Applet; import java.awt.event.*;  public class PlayBalloon extends Applet implements ActionListener {   private Button grow, shrink, left, right;  private ColoredBalloon myRedBalloon;    public void init() {     makeGui();      myRedBalloon = new ColoredBalloon(255, 0, 0);        } // init    public void paint(Graphics g) {   myRedBalloon.display(g);  } // paint      public void actionPerformed(ActionEvent e) {     if (e.getSource() == grow)    myRedBalloon.grow();   if (e.getSource() == shrink)    myRedBalloon.shrink();   if (e.getSource() == left)    myRedBalloon.left();   if (e.getSource() == right)    myRedBalloon.right();       repaint();  } // actionPerformed   private void makeGui() {   grow = new Button("Grow");   add(grow);   grow.addActionListener(this);      shrink = new Button("Shrink");   add(shrink);   shrink.addActionListener(this);      left = new Button("Left");   add(left);   left.addActionListener(this);      right = new Button("Right");   add(right);   right.addActionListener(this);     } // makeGui } // PlayBaloon   //---contents of Balloon.java------  /*  The Balloon class is defined here   */  import java.awt.*;  class Balloon {    int diameter = 10;    int xCoord = 20, yCoord = 50;    public void display(Graphics g) {     g.drawOval(xCoord, yCoord, diameter, diameter);     } // display    public void left() {     xCoord = xCoord - 10;    } // left    public void right() {     xCoord = xCoord + 10;     } // right    public void grow() {     diameter = diameter + 5;     } // grow    public void shrink() {     diameter = diameter - 5;     } // shrink  } // Balloon  class ColoredBalloon extends Balloon {   private Color color = new Color(200, 200, 200); // some default color    public ColoredBalloon(int r, int g, int b) {   color = new Color(r, g, b);  }    public void display(Graphics g) {     g.setColor(color);   g.fillOval(xCoord, yCoord, diameter, diameter);     } // display   } // ColoredBalloon &lt;/pre&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:monospace;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span"   style="  line-height: 19px; font-family:sans-serif;font-size:13px;"&gt;&lt;h2  style="color: black; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; font-weight: normal; margin-top: 0px; margin-right: 0px; margin-bottom: 0.6em; margin-left: 0px; padding-top: 0.5em; padding-bottom: 0.17em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(170, 170, 170);  background-position: initial initial; font-size:19px;"&gt;&lt;span class="mw-headline" id="Advantages"&gt;Advantages&lt;/span&gt;&lt;/h2&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;A Java applet can have any or all of the following advantages:&lt;/p&gt;&lt;ul style="line-height: 1.5em; list-style-type: square; margin-top: 0.3em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 1.5em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: url(http://en.wikipedia.org/skins-1.5/monobook/bullet.gif); "&gt;&lt;li style="margin-bottom: 0.1em; "&gt;It is simple to make it work on Linux, Windows and Mac OS i.e. to make it cross platform. Applets are supported by most &lt;a href="http://en.wikipedia.org/wiki/Web_browser" title="Web browser" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: initial initial; "&gt;web browsers&lt;/a&gt;&lt;/li&gt;&lt;li style="margin-bottom: 0.1em; "&gt;The same applet can work on "all" installed versions of Java at the same time, rather than just the latest &lt;a href="http://en.wikipedia.org/wiki/Plug-in" title="Plug-in" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: initial initial; "&gt;plug-in&lt;/a&gt; version only. However, if an applet requires a later version of the JRE the client will be forced to wait during the large download.&lt;/li&gt;&lt;li style="margin-bottom: 0.1em; "&gt;Most web browsers &lt;a href="http://en.wikipedia.org/wiki/Cache" title="Cache" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: initial initial; "&gt;cache&lt;/a&gt; applets, so will be quick to load when returning to a web page. Applets also improve with use: after a first applet is run, the JVM is already running and starts quickly (JVM will need to restart each time the browser starts fresh).&lt;/li&gt;&lt;li style="margin-bottom: 0.1em; "&gt;It can move the work from the &lt;a href="http://en.wikipedia.org/wiki/Server_(computing)" title="Server (computing)" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: initial initial; "&gt;server&lt;/a&gt; to the &lt;a href="http://en.wikipedia.org/wiki/Client_(computing)" title="Client (computing)" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: initial initial; "&gt;client&lt;/a&gt;, making a web solution more scalable with the number of users/clients&lt;/li&gt;&lt;li style="margin-bottom: 0.1em; "&gt;If standalone program (like &lt;a href="http://en.wikipedia.org/wiki/Google_Earth" title="Google Earth" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: initial initial; "&gt;Google Earth&lt;/a&gt;) talks to the web server, that server normally needs to support also previous versions as the user may not keep it always updated. Differently, the browser updates the applet so there is no need to support the legacy versions. Only due configuration mistakes the applet may get stuck in the cache and have issues when new versions come out.&lt;/li&gt;&lt;li style="margin-bottom: 0.1em; "&gt;The applet naturally supports the changing user state like figure positions on the chessboard.&lt;/li&gt;&lt;li style="margin-bottom: 0.1em; "&gt;Developers can develop and debug an applet direct simply by creating a main routine (either in the applet's class or in a separate class) and call init() and start() on the applet, thus allowing for development in their favorite J2SE development environment. All one has to do after that is re-test the applet in the appletviewer program or a web browser to ensure it conforms to security restrictions.&lt;/li&gt;&lt;li style="margin-bottom: 0.1em; "&gt;An untrusted applet has no access to the local machine and can only access the server it came from. This makes such applet much safer to run than standalone executable that it could replace. However signed applet can have full access to the machine it is running on if the user agrees.&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica;"&gt;&lt;span class="Apple-style-span"  style=" line-height: 22px;font-size:small;"&gt;&lt;span class="Apple-style-span"   style="  line-height: 19px; font-family:sans-serif;font-size:13px;"&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h2  style="color: black; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; font-weight: normal; margin-top: 0px; margin-right: 0px; margin-bottom: 0.6em; margin-left: 0px; padding-top: 0.5em; padding-bottom: 0.17em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(170, 170, 170);  background-position: initial initial; font-size:19px;"&gt;&lt;span class="mw-headline" id="Disadvantages"&gt;Disadvantages&lt;/span&gt;&lt;/h2&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;A Java applet may have any of the following disadvantages:&lt;/p&gt;&lt;ul style="line-height: 1.5em; list-style-type: square; margin-top: 0.3em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 1.5em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: url(http://en.wikipedia.org/skins-1.5/monobook/bullet.gif); "&gt;&lt;li style="margin-bottom: 0.1em; "&gt;It requires the Java &lt;a href="http://en.wikipedia.org/wiki/Plug-in" title="Plug-in" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;plug-in&lt;/span&gt;&lt;/a&gt; that may not available on some less popular &lt;a href="http://en.wikipedia.org/wiki/Web_browser" title="Web browser" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;web browser&lt;/span&gt;&lt;/a&gt; or operating systems.&lt;/li&gt;&lt;li style="margin-bottom: 0.1em; "&gt;Some organizations only allow software installed by the administrators. As a result, some users can only view applets that are important enough to contact the administrator asking to install Java plug-in.&lt;/li&gt;&lt;li style="margin-bottom: 0.1em; "&gt;As with any client side scripting, security restrictions may make difficult or even impossible for untrusted applet to achieve the desired goals.&lt;/li&gt;&lt;li style="margin-bottom: 0.1em; "&gt;Some more badly designed code may require a specific JRE.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3513789510947098583-4266753350455501943?l=learningjava-aman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningjava-aman.blogspot.com/feeds/4266753350455501943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningjava-aman.blogspot.com/2009/10/java-applet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/4266753350455501943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/4266753350455501943'/><link rel='alternate' type='text/html' href='http://learningjava-aman.blogspot.com/2009/10/java-applet.html' title='Java applet'/><author><name>Aman</name><uri>http://www.blogger.com/profile/03773653410891253027</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_diNGa3MkxCw/SqcDfOOm22I/AAAAAAAAAFI/-tCtENbzY0s/S220/aman+surat+(101).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3513789510947098583.post-8856811923369648978</id><published>2009-10-01T10:14:00.000-07:00</published><updated>2009-10-13T10:22:46.608-07:00</updated><title type='text'>java.io.File</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: verdana, tahoma, arial, sans-serif; line-height: 16px; "&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="color:#CC0000;"&gt;java.io.File&lt;/span&gt; is the central class in working with files and directories.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: verdana, tahoma, arial, sans-serif; line-height: 16px; "&gt;&lt;span&gt;&lt;span&gt;Files and directories are both represented by File objects. When a File object is created, the system doesn't test to see if a corresponding file/directory actually exists; you must call exists() to check.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:verdana, tahoma, arial, sans-serif;"&gt;&lt;span class="Apple-style-span" style="line-height: 16px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:verdana, tahoma, arial, sans-serif;"&gt;&lt;span class="Apple-style-span" style="line-height: 16px;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; "&gt;&lt;img src="http://www.blogger.com/img/blank.gif" alt="Align Left" border="0" class="gl_align_left" /&gt;&lt;table border="0" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;&lt;tr valign="top"&gt;&lt;td colspan="3" class="rowheader" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; background-color: rgb(192, 192, 192); font-style: italic; "&gt;&lt;i&gt;Constructors&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;new File(&lt;i&gt;path&lt;/i&gt;);&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;Create File object for default directory (usually where program is located).&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;new File(&lt;i&gt;dirpath&lt;/i&gt;, &lt;i&gt;fname&lt;/i&gt;);&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;Create File object for directory path given as string.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;new File(&lt;i&gt;dir&lt;/i&gt;, &lt;i&gt;fname&lt;/i&gt;);&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;Create File object for directory.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td colspan="3" class="rowheader" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; background-color: rgb(192, 192, 192); font-style: italic; "&gt;&lt;i&gt;public static constants&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;s&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;File.separator;&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;Default path separator (eg, "/" in Unix, "\" in Windows).&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td colspan="3" class="rowheader" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; background-color: rgb(192, 192, 192); font-style: italic; "&gt;&lt;i&gt;Getting Attributes&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;b&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;exists&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;true if file exists.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;b&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;isFile&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;true if this is a normal file.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;b&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;isDirectory&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;true if f is a directory.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;s&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;getName&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;name of file or directory.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;b&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;canRead&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;true if can read file.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;b&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;canWrite&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;true if can write file.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;b&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;isHidden&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;true if file is hidden.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;l&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;lastModified&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;Time of last modification.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;l&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;length&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;Number of bytes in file.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td colspan="3" class="rowheader" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; background-color: rgb(192, 192, 192); font-style: italic; "&gt;&lt;i&gt;Setting Attributes&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt; &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;setLastModified&lt;/b&gt;(&lt;i&gt;t&lt;/i&gt;);&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;Sets last modified time to long value &lt;i&gt;t&lt;/i&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;b&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;setReadOnly&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;Make file read only. Returns true if successful.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td colspan="3" class="rowheader" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; background-color: rgb(192, 192, 192); font-style: italic; "&gt;&lt;i&gt;Paths&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;s&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;getPath&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;path name.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;s&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;getAbsolutePath&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;path name (how is it different from above?).&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;s&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;getCanonicalPath&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;path name. May throw IOException.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;s&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;toURL&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;path with "file:" prefix and /'s. Directory paths end with /.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;s&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;toURI&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;path with "file:" prefix and /'s. Directory paths end with /.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td colspan="3" class="rowheader" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; background-color: rgb(192, 192, 192); font-style: italic; "&gt;&lt;i&gt;Creating and deleting files and directories&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;b&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;delete&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;Deletes the file.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;b&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;createNewFile&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;Create file, may throw IOException. true if OK; false if already exists.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;b&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;renameTo&lt;/b&gt;(&lt;i&gt;f2&lt;/i&gt;);&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;Renames &lt;i&gt;f&lt;/i&gt; to File &lt;i&gt;f2&lt;/i&gt;. Returns true if successful.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;b&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;mkdir&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;Creates a directory. Returns true if successful.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;b&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;mkdirs&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;Creates directory and all dirs in path. Returns true if successful.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td colspan="3" class="rowheader" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; background-color: rgb(192, 192, 192); font-style: italic; "&gt;&lt;i&gt;Parents and Children&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;s&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;getParent&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;Name of parent directory.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;dir&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;f&lt;/i&gt;.&lt;b&gt;getParentFile&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;File of parent.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td nowrap="nowrap" align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;sa&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;dir&lt;/i&gt;.&lt;b&gt;list&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;Array of file/directory names in &lt;i&gt;dir&lt;/i&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;fa&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;dir&lt;/i&gt;.&lt;b&gt;listFiles&lt;/b&gt;();&lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;Array of files/directories in &lt;i&gt;dir&lt;/i&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td align="right" style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;fa&lt;/i&gt; = &lt;/code&gt;&lt;/td&gt;&lt;td style="font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;&lt;code&gt;&lt;i&gt;dir&lt;/i&gt;.&lt;b&gt;listFiles&lt;/b&gt;(&lt;i&gt;ff&lt;/i&gt;);&lt;/code&gt;&lt;/td&gt;&lt;td style="text-align: left;font: normal normal normal 11px/16px verdana, tahoma, arial, sans-serif; "&gt;As above after applying &lt;a href="http://www.leepoint.net/notes-java/io/10file/05file.html" style="text-decoration: none;"&gt;&lt;span class="Apple-style-span"  style=";color:#000000;"&gt;java.io.FileFilte&lt;span class="Apple-style-span" style="text-decoration: underline;text-decoration: none; "&gt;r&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; &lt;i&gt;ff&lt;/i&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:verdana, tahoma, arial, sans-serif;"&gt;&lt;span class="Apple-style-span" style="line-height: 16px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:verdana, tahoma, arial, sans-serif;"&gt;&lt;span class="Apple-style-span" style="line-height: 16px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3513789510947098583-8856811923369648978?l=learningjava-aman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningjava-aman.blogspot.com/feeds/8856811923369648978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningjava-aman.blogspot.com/2009/10/javaiofile.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/8856811923369648978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/8856811923369648978'/><link rel='alternate' type='text/html' href='http://learningjava-aman.blogspot.com/2009/10/javaiofile.html' title='java.io.File'/><author><name>Aman</name><uri>http://www.blogger.com/profile/03773653410891253027</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_diNGa3MkxCw/SqcDfOOm22I/AAAAAAAAAFI/-tCtENbzY0s/S220/aman+surat+(101).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3513789510947098583.post-2645417601798028195</id><published>2009-09-11T20:21:00.000-07:00</published><updated>2009-10-13T20:35:45.984-07:00</updated><title type='text'>Java-chess board</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_diNGa3MkxCw/StVGiyO9fOI/AAAAAAAAAHQ/aWS_Qx31aa8/s1600-h/chess16-2.gif"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 200px; height: 200px;" src="http://4.bp.blogspot.com/_diNGa3MkxCw/StVGiyO9fOI/AAAAAAAAAHQ/aWS_Qx31aa8/s200/chess16-2.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5392293692260056290" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; import java.awt.*;&lt;br /&gt; import java.awt.geom.*;&lt;br /&gt; import javax.swing.*;&lt;br /&gt;&lt;br /&gt;public class chessboard {&lt;br /&gt; &lt;br /&gt;  public static void main(String[] args)&lt;br /&gt;     {&lt;br /&gt;        DrawFrame frame = new DrawFrame();&lt;br /&gt;        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);&lt;br /&gt;        frame.show();&lt;br /&gt;     }      &lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;/**&lt;br /&gt;     A frame that contains a panel with drawings&lt;br /&gt; */&lt;br /&gt; class DrawFrame extends JFrame&lt;br /&gt; {&lt;br /&gt;     static int one_for_all=700; //decides the width and heigth ofthe frame&lt;br /&gt;     Toolkit kit = Toolkit.getDefaultToolkit();&lt;br /&gt;       Dimension screenSize = kit.getScreenSize();&lt;br /&gt;       public int screenHeight = screenSize.height;&lt;br /&gt;       public int screenWidth = screenSize.width;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;     public DrawFrame()&lt;br /&gt;     {            &lt;br /&gt;      setSize(FRAME_WIDTH, FRAME_HEIGHT);&lt;br /&gt;        // center frame in screen       &lt;br /&gt;       setLocation(screenWidth / 4, screenHeight / 4);&lt;br /&gt;       setResizable(true);      &lt;br /&gt;       setTitle("A Standard Chess Board");       &lt;br /&gt;       setUndecorated(false);//try changing TRUE | FALSE       &lt;br /&gt;       /*The title bar, title, frame border, close(X) button everything will be removed&lt;br /&gt;         What you will see will just be a plain frame,a plain area.&lt;br /&gt;        */&lt;br /&gt; &lt;br /&gt;        // add panel to frame&lt;br /&gt; &lt;br /&gt;        DrawPanel panel = new DrawPanel();&lt;br /&gt;        Container contentPane = getContentPane();&lt;br /&gt;        contentPane.add(panel);&lt;br /&gt;     }&lt;br /&gt;     public static final int FRAME_WIDTH = one_for_all;&lt;br /&gt;     public static final int FRAME_HEIGHT = one_for_all;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; /**&lt;br /&gt;     A panel that displays rectangles and ellipses.&lt;br /&gt; */&lt;br /&gt; class DrawPanel extends JPanel&lt;br /&gt;{    &lt;br /&gt;    public void paintComponent(Graphics g)&lt;br /&gt;    {&lt;br /&gt;       DrawFrame frame = new DrawFrame();&lt;br /&gt;       int XXX=25;//x coordinate of the point where drawing starts&lt;br /&gt;       int YYY=25;//x coordinate of the point where drawing starts&lt;br /&gt;       System.out.println(XXX);&lt;br /&gt;       int co_x=XXX;&lt;br /&gt;       int co_y=YYY;&lt;br /&gt;       int no=8;   // value of no should be at the most frameSize/10&lt;br /&gt;       int size=80; //size of each box&lt;br /&gt;       boolean flag=false;&lt;br /&gt;       setBackground(new Color(80,40,40));&lt;br /&gt;       super.paintComponent(g);&lt;br /&gt;       Graphics2D g2 = (Graphics2D)g;       &lt;br /&gt;       for(int j=0;j&lt;no;j++)&lt;br /&gt;       {&lt;br /&gt;       if(j%2==0)&lt;br /&gt;        {flag=false;}&lt;br /&gt;       else if(j%2==1)&lt;br /&gt;        {flag=true;}  &lt;br /&gt;       co_x=XXX;&lt;br /&gt;       for(int i=0;i&lt;no;i++)&lt;br /&gt;        {                &lt;br /&gt;        if(flag==true)&lt;br /&gt;        {&lt;br /&gt;        g2.setPaint(Color.WHITE);&lt;br /&gt;        g2.fill(new Rectangle2D.Double(co_x,co_y,size,size));&lt;br /&gt;        flag=false;&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;        g2.setPaint(Color.BLACK);&lt;br /&gt;        g2.fill(new Rectangle2D.Double(co_x,co_y,size,size));&lt;br /&gt;        flag=true;&lt;br /&gt;        }&lt;br /&gt;        co_x+=size;&lt;br /&gt;       }                       &lt;br /&gt;       co_y+=size;&lt;br /&gt;       }&lt;br /&gt;    }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3513789510947098583-2645417601798028195?l=learningjava-aman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningjava-aman.blogspot.com/feeds/2645417601798028195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningjava-aman.blogspot.com/2009/09/java-chess-board.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/2645417601798028195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/2645417601798028195'/><link rel='alternate' type='text/html' href='http://learningjava-aman.blogspot.com/2009/09/java-chess-board.html' title='Java-chess board'/><author><name>Aman</name><uri>http://www.blogger.com/profile/03773653410891253027</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_diNGa3MkxCw/SqcDfOOm22I/AAAAAAAAAFI/-tCtENbzY0s/S220/aman+surat+(101).JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_diNGa3MkxCw/StVGiyO9fOI/AAAAAAAAAHQ/aWS_Qx31aa8/s72-c/chess16-2.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3513789510947098583.post-8422128981702206606</id><published>2009-09-01T20:19:00.000-07:00</published><updated>2009-10-15T20:57:12.173-07:00</updated><title type='text'>JAVA API</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_diNGa3MkxCw/Stfuxku31JI/AAAAAAAAAJ4/VETmQVaxeTU/s1600-h/s%2Bserver_webapp_architecture.PNG"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 162px; height: 200px;" src="http://3.bp.blogspot.com/_diNGa3MkxCw/Stfuxku31JI/AAAAAAAAAJ4/VETmQVaxeTU/s200/s%2Bserver_webapp_architecture.PNG" border="0" alt="" id="BLOGGER_PHOTO_ID_5393041614240732306" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_diNGa3MkxCw/StfqJRmt1_I/AAAAAAAAAJw/mDLB9Xp4Dw4/s1600-h/s%2Bserver_webapp_architecture.PNG"&gt;&lt;/a&gt;&lt;span&gt;&lt;span&gt;There are three types of Java Programming Language Application Programming Interfaces (APIs) :the official core Java API, contained in the JDK or JRE, of one of the editions of the Java Platform. The three editions of the Java Platform are Java ME (Micro edition), Java SE (Standard edition), and Java EE (Enterprise edition).optional official APIs that can be downloaded separately. The specification of these APIs are defined according to a Java Specification Request (JSR), and sometimes some of these APIs are later included in the core APIs of the platform (the most notable example of this kind is Swing).unofficial APIs, developed by third parties, but not related to any JSRs.It must be noted that third-parties can freely implement any JSR specifications for an official API (even for the core API of the language), providing that they conform to the Technology Compatibility Kit (TCK) for this JSR (the TCK is a suite of tests that checks conformance of implementations for a JSR). The result of this freedom is that many official APIs have more implementations than the Sun's Reference implementation (RI).&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3513789510947098583-8422128981702206606?l=learningjava-aman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningjava-aman.blogspot.com/feeds/8422128981702206606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningjava-aman.blogspot.com/2009/09/java-api.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/8422128981702206606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/8422128981702206606'/><link rel='alternate' type='text/html' href='http://learningjava-aman.blogspot.com/2009/09/java-api.html' title='JAVA API'/><author><name>Aman</name><uri>http://www.blogger.com/profile/03773653410891253027</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_diNGa3MkxCw/SqcDfOOm22I/AAAAAAAAAFI/-tCtENbzY0s/S220/aman+surat+(101).JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_diNGa3MkxCw/Stfuxku31JI/AAAAAAAAAJ4/VETmQVaxeTU/s72-c/s%2Bserver_webapp_architecture.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3513789510947098583.post-4650216553052941431</id><published>2009-08-23T21:16:00.000-07:00</published><updated>2009-10-23T21:27:42.568-07:00</updated><title type='text'></title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://java.sun.com/javaee/5/docs/tutorial/doc/figures/web-requestHandling.gif"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 409px; height: 257px;" src="http://java.sun.com/javaee/5/docs/tutorial/doc/figures/web-requestHandling.gif" border="0" alt="" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"   style="  line-height: 19px; font-family:sans-serif;font-size:13px;"&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;&lt;b&gt;Servlets&lt;/b&gt; are Java programming language objects that dynamically process requests and construct responses. The &lt;b&gt;Java Servlet API&lt;/b&gt; allows a &lt;a href="http://en.wikipedia.org/wiki/Software_developer" title="Software developer" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;software developer&lt;/span&gt;&lt;/a&gt; to add dynamic content to a &lt;a href="http://en.wikipedia.org/wiki/Web_server" title="Web server" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Web server&lt;/span&gt;&lt;/a&gt;using the &lt;a href="http://en.wikipedia.org/wiki/Java_platform" title="Java platform" class="mw-redirect" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Java platform&lt;/span&gt;&lt;/a&gt;. The generated content is commonly &lt;a href="http://en.wikipedia.org/wiki/HTML" title="HTML" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;HTML&lt;/span&gt;&lt;/a&gt;, but may be other data such as &lt;a href="http://en.wikipedia.org/wiki/XML" title="XML" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;XML&lt;/span&gt;&lt;/a&gt;. Servlets are the Java counterpart to non-Java dynamic Web content technologies such as &lt;a href="http://en.wikipedia.org/wiki/PHP" title="PHP" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;PHP&lt;/span&gt;&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Common_Gateway_Interface" title="Common Gateway Interface" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;CGI&lt;/span&gt;&lt;/a&gt; and&lt;a href="http://en.wikipedia.org/wiki/Active_Server_Pages" title="Active Server Pages" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;, and as such some find it easier to think of them as 'Java scripts'. Servlets can maintain state across many server transactions by using &lt;a href="http://en.wikipedia.org/wiki/HTTP_cookie" title="HTTP cookie" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;HTTP cookies&lt;/span&gt;&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Session_(computer_science)" title="Session (computer science)" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;session&lt;/span&gt;&lt;/a&gt; variables or &lt;a href="http://en.wikipedia.org/wiki/URL_rewriting" title="URL rewriting" class="mw-redirect" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;URL rewriting&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;The servlet &lt;a href="http://en.wikipedia.org/wiki/Application_programming_interface" title="Application programming interface" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;API&lt;/span&gt;&lt;/a&gt;, contained in the &lt;a href="http://en.wikipedia.org/wiki/Java_package" title="Java package" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Java package&lt;/span&gt;&lt;/a&gt; hierarchy &lt;span class="Apple-style-span"  style="font-family:monospace;"&gt;javax.servlet&lt;/span&gt;, defines the expected interactions of a &lt;a href="http://en.wikipedia.org/wiki/Web_container" title="Web container" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Web container&lt;/span&gt;&lt;/a&gt; and a servlet. A Web container is essentially the component of a Web server that interacts with the servlets. The Web container is responsible for managing the lifecycle of servlets, mapping a URL to a particular servlet and ensuring that the URL requester has the correct access rights.&lt;/p&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;&lt;span class="Apple-style-span"  style=" line-height: 19px; font-size:13px;"&gt;Servlets can be generated automatically by &lt;a href="http://en.wikipedia.org/wiki/JavaServer_Pages" title="JavaServer Pages" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;JavaServer Pages&lt;/span&gt;&lt;/a&gt; (JSP) compiler, or alternately use template engines such as &lt;a href="http://en.wikipedia.org/wiki/WebMacro" title="WebMacro" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;WebMacro&lt;/span&gt;&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/w/index.php?title=Apache_velocity&amp;amp;action=edit&amp;amp;redlink=1" class="new" title="Apache velocity (page does not exist)" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Apache velocity&lt;/span&gt;&lt;/a&gt; to generate HTML. Often servlets are used in conjunction with JSPs in a pattern called "&lt;a href="http://en.wikipedia.org/wiki/Model_2" title="Model 2" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Model 2&lt;/span&gt;&lt;/a&gt;", which is a flavor of the &lt;a href="http://en.wikipedia.org/wiki/Model-view-controller" title="Model-view-controller" class="mw-redirect" style="text-decoration: none; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;model-view-controller&lt;/span&gt;&lt;/a&gt; pattern.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;&lt;span class="Apple-style-span"  style="font-size:100%;"&gt;&lt;span class="Apple-style-span"  style=" line-height: 19px;font-size:13px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="Apple-style-span"  style="font-size:100%;"&gt;&lt;h2  style="color: black; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; font-weight: normal; margin-top: 0px; margin-right: 0px; margin-bottom: 0.6em; margin-left: 0px; padding-top: 0.5em; padding-bottom: 0.17em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(170, 170, 170);  background-position: initial initial; font-size:19px;"&gt;&lt;span class="mw-headline" id="Lifecycle_of_a_servlet"&gt;Lifecycle of a servlet&lt;/span&gt;&lt;/h2&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;The servlet lifecycle consists of the following steps:&lt;/p&gt;&lt;ol style="line-height: 1.5em; margin-top: 0.3em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 3.2em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: none; "&gt;&lt;li style="margin-bottom: 0.1em; "&gt;The servlet class is loaded by the container during start-up.&lt;/li&gt;&lt;li style="margin-bottom: 0.1em; "&gt;The container calls the &lt;code style="background-color: rgb(249, 249, 249); "&gt;init()&lt;/code&gt; method. This method initializes the servlet and must be called before the servlet can service any requests. In the entire life of a servlet, the &lt;code style="background-color: rgb(249, 249, 249); "&gt;init()&lt;/code&gt;method is called only once.&lt;/li&gt;&lt;li style="margin-bottom: 0.1em; "&gt;After initialization, the servlet can service client requests. Each request is serviced in its own separate thread. The container calls the &lt;code style="background-color: rgb(249, 249, 249); "&gt;service()&lt;/code&gt; method of the servlet for every request. The &lt;code style="background-color: rgb(249, 249, 249); "&gt;service()&lt;/code&gt; method determines the kind of request being made and dispatches it to an appropriate method to handle the request. The developer of the servlet must provide an implementation for these methods. If a request for a method that is not implemented by the servlet is made, the method of the parent class is called, typically resulting in an error being returned to the requester.&lt;/li&gt;&lt;li style="margin-bottom: 0.1em; "&gt;Finally, the container calls the &lt;code style="background-color: rgb(249, 249, 249); "&gt;destroy()&lt;/code&gt; method that takes the servlet out of service. The &lt;code style="background-color: rgb(249, 249, 249); "&gt;destroy()&lt;/code&gt; method like &lt;code style="background-color: rgb(249, 249, 249); "&gt;init()&lt;/code&gt; is called only once in the lifecycle of a servlet.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  line-height: normal; font-family:monospace;font-size:10px;"&gt;&lt;pre class="de1" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-top-color: white; border-right-color: white; border-bottom-color: white; border-left-color: white; color: black; background-color: initial; line-height: normal; font: normal normal normal 1em/1.2em monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; vertical-align: top; background-position: initial initial; "&gt;&lt;pre&gt; &lt;/pre&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;pre&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3513789510947098583-4650216553052941431?l=learningjava-aman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningjava-aman.blogspot.com/feeds/4650216553052941431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningjava-aman.blogspot.com/2009/08/servlets-are-java-programming-language.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/4650216553052941431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/4650216553052941431'/><link rel='alternate' type='text/html' href='http://learningjava-aman.blogspot.com/2009/08/servlets-are-java-programming-language.html' title=''/><author><name>Aman</name><uri>http://www.blogger.com/profile/03773653410891253027</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_diNGa3MkxCw/SqcDfOOm22I/AAAAAAAAAFI/-tCtENbzY0s/S220/aman+surat+(101).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3513789510947098583.post-4220693488622089017</id><published>2009-08-18T05:58:00.000-07:00</published><updated>2009-10-16T06:00:20.965-07:00</updated><title type='text'>Some More Jave Interview Questions</title><content type='html'>&lt;span class="Apple-style-span"   style="  color: rgb(51, 51, 51); line-height: 19px; font-family:Verdana, sans-serif;font-size:small;"&gt;&lt;h3 class="post-title"   style="margin-top: 0px;   letter-spacing: -1px; color: rgb(153, 51, 51); font-family:Verdana, 'Lucida Grande', 'Trebuchet MS';font-size:17px;"&gt;&lt;span class="Apple-style-span"   style="color: rgb(51, 51, 51);   font-weight: normal; letter-spacing: normal; font-family:Verdana, sans-serif;font-size:small;"&gt;&lt;span style=" ;font-family:arial;"&gt;&lt;strong&gt;1. What is J2EE?&lt;br /&gt;&lt;/strong&gt;J2EE is an environment for developing and deploying enterprise applications. The J2EE platform consists of a set of services, application programming interfaces (APIs), and protocols that provide the functionality for developing multitiered, web-based applications.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. What is the J2EE module?&lt;/strong&gt;&lt;br /&gt;A J2EE module consists of one or more J2EE components for the same container type and one component deployment descriptor of that type.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. What are the components of J2EE application? &lt;/strong&gt;&lt;br /&gt;A J2EE component is a self-contained functional software unit that is assembled into a J2EE application with its related classes and files and communicates with other components. The J2EE specification defines the following J2EE components:&lt;br /&gt;Application clients and applets are client components.&lt;br /&gt;Java Servlet and JavaServer PagesTM (JSPTM) technology components are web components.&lt;br /&gt;Enterprise JavaBeansTM (EJBTM) components (enterprise beans) are business components.&lt;br /&gt;Resource adapter components provided by EIS and tool vendors.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=" ;font-family:arial;"&gt;&lt;strong&gt;4. What are the four types of J2EE modules?&lt;br /&gt;&lt;/strong&gt;1. Application client module&lt;br /&gt;2. Web module&lt;br /&gt;3. Enterprise JavaBeans module&lt;br /&gt;4. Resource adapter module&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. What does application client module contain? &lt;/strong&gt;&lt;br /&gt;The application client module contains:&lt;br /&gt;--class files,&lt;br /&gt;--an application client deployment descriptoor.&lt;br /&gt;Application client modules are packaged as JAR files with a .jar extension.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=" ;font-family:arial;"&gt;&lt;strong&gt;6. What does web module contain?&lt;br /&gt;&lt;/strong&gt;The web module contains:&lt;br /&gt;--JSP files,&lt;br /&gt;--class files for servlets,&lt;br /&gt;--GIF and HTML files, and&lt;br /&gt;--a Web deployment descriptor.&lt;br /&gt;Web modules are packaged as JAR files with a .war (Web ARchive) extension.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;7. What are the differences between Ear, Jar and War files? Under what circumstances should we use each one? &lt;/strong&gt;&lt;br /&gt;There are no structural differences between the files; they are all archived using zip-jar compression. However, they are intended for different purposes.&lt;br /&gt;--Jar files (files with a .jar extension) arre intended to hold generic libraries of Java classes, resources, auxiliary files, etc.&lt;br /&gt;--War files (files with a .war extension) arre intended to contain complete Web applications. In this context, a Web application is defined as a single group of files, classes, resources, .jar files that can be packaged and accessed as one servlet context.&lt;br /&gt;--Ear files (files with a .ear extension) arre intended to contain complete enterprise applications. In this context, an enterprise application is defined as a collection of .jar files, resources, classes, and multiple Web applications.&lt;br /&gt;Each type of file (.jar, .war, .ear) is processed uniquely by application servers, servlet containers, EJB containers, etc.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=" ;font-family:arial;"&gt;&lt;strong&gt;8. What is the difference between Session bean and Entity bean?one?&lt;br /&gt;&lt;/strong&gt;The Session bean and Entity bean are two main parts of EJB container.&lt;br /&gt;Session Bean&lt;br /&gt;--represents a workflow on behalf of a cliennt&lt;br /&gt;--one-to-one logical mapping to a client. --created and destroyed by a client&lt;br /&gt;--not permanent objects&lt;br /&gt;--lives its EJB container(generally) does noot survive system shut down&lt;br /&gt;--two types: stateless and stateful beans Entity Bean&lt;br /&gt;--represents persistent data and behavior off this data&lt;br /&gt;--can be shared among multiple clients&lt;br /&gt;--persists across multiple invocations&lt;br /&gt;--findable permanent objects&lt;br /&gt;--outlives its EJB container, survives systeem shutdown&lt;br /&gt;--two types: container managed persistence(CCMP) and bean managed persistence(BMP)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;9. What is "applet" ?&lt;/strong&gt;&lt;br /&gt;A J2EE component that typically executes in a Web browser but can execute in a variety of other applications or devices that support the applet programming model.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=" ;font-family:arial;"&gt;&lt;strong&gt;10. What is "applet container" ?&lt;br /&gt;&lt;/strong&gt;A container that includes support for the applet programming model.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;11. What is "application assembler" ?&lt;/strong&gt;&lt;br /&gt;A person who combines J2EE components and modules into deployable application units.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;12. What is "application client" ?&lt;/strong&gt;&lt;br /&gt;A first-tier J2EE client component that executes in its own Java virtual machine. Application clients have access to some J2EE platform APIs.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;13. What is "application client container" ?&lt;/strong&gt;&lt;br /&gt;A container that supports application client components.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;14. What is "application client module" ?&lt;/strong&gt;&lt;br /&gt;A software unit that consists of one or more classes and an application client deployment descriptor.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=" ;font-family:arial;"&gt;&lt;strong&gt;15. What is "application component provider" ?&lt;br /&gt;&lt;/strong&gt;A vendor that provides the Java classes that implement components' methods, JSP page definitions, and any required deployment descriptors.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;16. What is "application configuration resource file" ?&lt;/strong&gt;&lt;br /&gt;An XML file used to configure resources for a JavaServer Faces application, to define navigation rules for the application, and to register converters, validators, listeners, renderers, and components with the application.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;17. What is "archiving" ?&lt;/strong&gt;&lt;br /&gt;The process of saving the state of an object and restoring it.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=" ;font-family:arial;"&gt;&lt;strong&gt;18. What is "asant" ?&lt;br /&gt;&lt;/strong&gt;A Java-based build tool that can be extended using Java classes. The configuration files are XML-based, calling out a target tree where various tasks get executed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;19. What is "attribute"What is "asant" ?&lt;/strong&gt;&lt;br /&gt;A qualifier on an XML tag that provides additional information.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=" ;font-family:arial;"&gt;&lt;strong&gt;20. What is authentication ?&lt;br /&gt;&lt;/strong&gt;The process that verifies the identity of a user, device, or other entity in a computer system, usually as a prerequisite to allowing access to resources in a system. The Java servlet specification requires three types of authentication-basic, form-based, and mutual-and supports digest authentication.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=" ;font-family:arial;"&gt;&lt;strong&gt;21. What is authorization?&lt;br /&gt;&lt;/strong&gt;The process by which access to a method or resource is determined. Authorization depends on the determination of whether the principal associated with a request through authentication is in a given security role. A security role is a logical grouping of users defined by the person who assembles the application. A deployer maps security roles to security identities. Security identities may be principals or groups in the operational environment.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;22. What is authorization constraint ?&lt;/strong&gt;&lt;br /&gt;An authorization rule that determines who is permitted to access a Web resource collection.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;23. What is B2B ?&lt;/strong&gt;&lt;br /&gt;B2B stands for Business-to-business.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;24. What is backing bean ?&lt;/strong&gt;&lt;br /&gt;A JavaBeans component that corresponds to a JSP page that includes JavaServer Faces components. The backing bean defines properties for the components on the page and methods that perform processing for the component. This processing includes event handling, validation, and processing associated with navigation.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;25. What is basic authentication ?&lt;/strong&gt;&lt;br /&gt;An authentication mechanism in which a Web server authenticates an entity via a user name and password obtained using the Web application's built-in authentication mechanism.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;26. What is bean-managed persistence ?&lt;/strong&gt;&lt;br /&gt;The mechanism whereby data transfer between an entity bean's variables and a resource manager is managed by the entity bean.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;27. What is bean-managed transaction ?&lt;/strong&gt;&lt;br /&gt;A transaction whose boundaries are defined by an enterprise bean.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;28. What is binding (XML) ?&lt;/strong&gt;&lt;br /&gt;Generating the code needed to process a well-defined portion of XML data.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;29. What is binding (JavaServer Faces technology) ?&lt;/strong&gt;&lt;br /&gt;Wiring UI components to back-end data sources such as backing bean properties.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;30. What is build file ?&lt;/strong&gt;&lt;br /&gt;The XML file that contains one or more asant targets. A target is a set of tasks you want to be executed. When starting asant, you can select which targets you want to have executed. When no target is given, the project's default target is executed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;31. What is business logic ?&lt;/strong&gt;&lt;br /&gt;The code that implements the functionality of an application. In the Enterprise JavaBeans architecture, this logic is implemented by the methods of an enterprise bean.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;32.What is business method ?&lt;/strong&gt;&lt;br /&gt;A method of an enterprise bean that implements the business logic or rules of an application.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;33. What is callback methods ?&lt;/strong&gt;&lt;br /&gt;Component methods called by the container to notify the component of important events in its life cycle.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;34. What is caller ?&lt;/strong&gt;&lt;br /&gt;Same as caller principal.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;35. What is caller principal ?&lt;/strong&gt;&lt;br /&gt;The principal that identifies the invoker of the enterprise bean method.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;36. What is cascade delete ?&lt;/strong&gt;&lt;br /&gt;A deletion that triggers another deletion. A cascade delete can be specified for an entity bean that has container-managed persistence.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;37. What is CDATA ?&lt;/strong&gt;&lt;br /&gt;A predefined XML tag for character data that means "don't interpret these characters," as opposed to parsed character data (PCDATA), in which the normal rules of XML syntax apply. CDATA sections are typically used to show examples of XML syntax.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;38. What is certificate authority ?&lt;/strong&gt;&lt;br /&gt;A trusted organization that issues public key certificates and provides identification to the bearer.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=" ;font-family:arial;"&gt;&lt;strong&gt;39. What is client-certificate authentication ?&lt;br /&gt;&lt;/strong&gt;An authentication mechanism that uses HTTP over SSL, in which the server and, optionally, the client authenticate each other with a public key certificate that conforms to a standard that is defined by X.509 Public Key Infrastructure.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;40. What is comment ?&lt;/strong&gt;&lt;br /&gt;In an XML document, text that is ignored unless the parser is specifically told to recognize it.&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3513789510947098583-4220693488622089017?l=learningjava-aman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningjava-aman.blogspot.com/feeds/4220693488622089017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningjava-aman.blogspot.com/2009/10/some-more-jave-interview-questions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/4220693488622089017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/4220693488622089017'/><link rel='alternate' type='text/html' href='http://learningjava-aman.blogspot.com/2009/10/some-more-jave-interview-questions.html' title='Some More Jave Interview Questions'/><author><name>Aman</name><uri>http://www.blogger.com/profile/03773653410891253027</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_diNGa3MkxCw/SqcDfOOm22I/AAAAAAAAAFI/-tCtENbzY0s/S220/aman+surat+(101).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3513789510947098583.post-5623718126493979637</id><published>2009-08-16T05:52:00.000-07:00</published><updated>2009-10-16T05:56:51.297-07:00</updated><title type='text'>JDBC - ODBC Questions......</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: small; color: rgb(51, 51, 51); line-height: 19px; "&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;1. What's the JDBC 2.0 API?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;The JDBC 2.0 API is the latest update of the JDBC API. It contains many new features, including scrollable result sets and the new SQL:1999 (formerly SQL 3) data types. There are two parts to the JDBC 2.0 API:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;the JDBC 2.0 core API (the java.sql package), which is included in the JavaTM 2 SDK, Standard Edition&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;the JDBC 2.0 Optional Package API (the javax.sql package), which is available separately or as part of the Java 2 SDK, Enterprise Edition&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;2. Does the JDBC-ODBC Bridge support the new features in the JDBC 2.0 API?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;No, the JDBC-ODBC Bridge that is included in the Java 2 Platform initial release does not support the new features in the JDBC 2.0 API. However, Sun and Merant are working to produce a new version of the Bridge that does support the new features. Note that we do not recommend using the Bridge except for experimental purposes or when you have no other driver available.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;3. Can the JDBC-ODBC Bridge be used with applets?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Use of the JDBC-ODBC bridge from an untrusted applet running in a browser, such as Netscape Navigator, isn't allowed. The JDBC-ODBC bridge doesn't allow untrusted code to call it for security reasons. This is good because it means that an untrusted applet that is downloaded by the browser can't circumvent Java security by calling ODBC. Remember that ODBC is native code, so once ODBC is called, the Java programming language can't guarantee that a security violation won't occur. On the other hand, Pure Java JDBC drivers work well with applets. They are fully downloadable and do not require any client-side configuration.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Finally, we would like to note that it is possible to use the JDBC-ODBC bridge with applets that will be run in appletviewer since appletviewer assumes that applets are trusted. It is also possible to use the JDBC-ODBC bridge with applets that are run in the HotJavaTM browser (available from Java Software), since HotJava provides an option to turn off applet security. In general, it is dangerous to turn applet security off, but it may be appropriate in certain controlled situations, such as for applets that will only be used in a secure intranet environment. Remember to exercise caution if you choose this option, and use an all-Java JDBC driver whenever possible to avoid security problems.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;4. How do I start debugging problems related to the JDBC API?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;A good way to find out what JDBC calls are doing is to enable JDBC tracing. The JDBC trace contains a detailed listing of the activity occurring in the system that is related to JDBC operations.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;If you use the DriverManager facility to establish your database connection, you use the DriverManager.setLogWriter method to enable tracing of JDBC operations. If you use a DataSource object to get a connection, you use the DataSource.setLogWriter method to enable tracing. (For pooled connections, you use the ConnectionPoolDataSource.setLogWriter method, and for connections that can participate in distributed transactions, you use the XADataSource.setLogWriter method.)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;5. How can I use the JDBC API to access a desktop database like Microsoft Access over the network?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Most desktop databases currently require a JDBC solution that uses ODBC underneath. This is because the vendors of these database products haven't implemented all-Java JDBC drivers.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;The best approach is to use a commercial JDBC driver that supports ODBC and the database you want to use. See the &lt;/span&gt;&lt;u&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span class="Apple-style-span" style="text-decoration: none;"&gt;JDBC drivers page&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt; for a list of available JDBC drivers.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;The JDBC-ODBC bridge from Sun's Java Software does not provide network access to desktop databases by itself. The JDBC-ODBC bridge loads ODBC as a local DLL, and typical ODBC drivers for desktop databases like Access aren't networked. The JDBC-ODBC bridge can be used together with the &lt;/span&gt;&lt;u&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span class="Apple-style-span" style="text-decoration: none;"&gt;RMI-JDBC bridge&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt; , however, to access a desktop database like Access over the net. This RMI-JDBC-ODBC solution is free.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;6. Does the JDK include the JDBC API and the JDBC-ODBC Bridge?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Yes, the JDK 1.1 and the Java 2 SDK, Standard Edition (formerly known as the JDK 1.2), contain both the JDBC API and the JDBC-ODBC Bridge. The Java 2 SDK, Standard Edition, contains the JDBC 2.0 core API, which is the latest version. It does not include the JDBC 2.0 Optional Package, which is part of the Java 2 SDK, Enterprise Edition, or which you can download separately.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Note that the version of the JDBC API and the JDBC-ODBC Bridge provided for separate download on the JDBC download page are only for use with the JDK 1.0.2.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;7. What JDBC technology-enabled drivers are available?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;See our &lt;/span&gt;&lt;u&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span class="Apple-style-span" style="text-decoration: none;"&gt;web page on JDBC technology-enabled drivers&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt; for a current listing.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;8. What documentation is available for the JDBC API?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;See the &lt;/span&gt;&lt;u&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span class="Apple-style-span" style="text-decoration: none;"&gt;JDBC technology home page&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt; for links to information about JDBC technology. This page links to information about features and benefits, a list of new features, a section on getting started, online tutorials, a section on driver requirements, and other information in addition to the specifications and javadoc documentation.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;9. Are there any ODBC drivers that do not work with the JDBC-ODBC Bridge?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Most ODBC 2.0 drivers should work with the Bridge. Since there is some variation in functionality between ODBC drivers, the functionality of the bridge may be affected. The bridge works with popular PC databases, such as Microsoft Access and FoxPro.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;10. Does the JDBC-ODBC Bridge work with Microsoft J++?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;No, J++ does not support the JDBC-ODBC bridge since it doesn't implement the Java Native Interface (JNI). Any all-Java JDBC driver should work with J++, however.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;11. What causes the "No suitable driver" error?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;"No suitable driver" is an error that usually occurs during a call to the DriverManager.getConnection method. The cause can be failing to load the appropriate JDBC drivers before calling the getConnection method, or it can be specifying an invalid JDBC URL--one that isn't recognized by your JDBC driver. Your best bet is to check the documentation for your JDBC driver or contact your JDBC driver vendor if you suspect that the URL you are specifying is not being recognized by your JDBC driver.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;In addition, when you are using the JDBC-ODBC Bridge, this error can occur if one or more the the shared libraries needed by the Bridge cannot be loaded. If you think this is the cause, check your configuration to be sure that the shared libraries are accessible to the Bridge.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;12. Why isn't the java.sql.DriverManager class being found?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;This problem can be caused by running a JDBC applet in a browser that supports the JDK 1.0.2, such as Netscape Navigator 3.0. The JDK 1.0.2 does not contain the JDBC API, so the DriverManager class typically isn't found by the Java virtual machine running in the browser.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Here's a solution that doesn't require any additional configuration of your web clients. Remember that classes in the java.* packages cannot be downloaded by most browsers for security reasons. Because of this, many vendors of all-Java JDBC drivers supply versions of the java.sql.* classes that have been renamed to jdbc.sql.*, along with a version of their driver that uses these modified classes. If you import jdbc.sql.* in your applet code instead of java.sql.*, and add the jdbc.sql.* classes provided by your JDBC driver vendor to your applet's codebase, then all of the JDBC classes needed by the applet can be downloaded by the browser at run time, including the DriverManager class.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;This solution will allow your applet to work in any client browser that supports the JDK 1.0.2. Your applet will also work in browsers that support the JDK 1.1, although you may want to switch to the JDK 1.1 classes for performance reasons. Also, keep in mind that the solution outlined here is just an example and that other solutions are possible.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;13. Why doesn't calling the method Class.forName load my JDBC driver?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;There is a bug in the JDK 1.1.x that can cause the method Class.forName to fail. A workaround is to explicitly call the method DriverManager.registerDriver(new YourDriverClass()). The exact problem in the JDK is a race condition in the class loader that prevents the static section of code in the driver class from executing and registering the driver with the DriverManager.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;14. Why do the java.sql and java.math packages fail to download java.* packages? Is there a workaround?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;For security reasons, browsers will not download java.* packages. In order to use the JDBC API with browsers that have not been upgraded to JDK1.1 or beyond, we recommend that the java.sql and java.math packages be renamed jdbc.sql and jdbc.math. Most vendors supplying JDBC technology-enabled drivers that are written purely in the Java programming language already provide versions of these renamed packages. When JDK 1.1 support has been added to your browser, you should convert your applets back to the java.* package names.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;15. Why is the precision of java.math.BigDecimal limited to 18 digits in the JDK 1.0.2 add-on version of the JDBC API?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;In JDK 1.1, java.math.BigInteger is implemented in C. It supports a precision of thousands of digits. The same is true for BigDecigmal.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;The version of BigInteger provided with the JDK 1.0.2 add-on version of the JDBC API is a simplified version written in the Java programming language, and it is limited to 18 digits. Because the implementation of BigDecimal is based on BigInteger, it also is limited to this precision.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;In the JDBC 2.0 API, you can use a new version of the method ResultSet.getBigDecimal that does not take a scale parameter and returns a BigDecimal with full precision.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;16. Can the JDBC API be added to JDK 1.0.2?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Yes. &lt;/span&gt;&lt;u&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span class="Apple-style-span" style="text-decoration: none;"&gt;Download the JDBC 1.22 API from the JDBC download page&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt; and follow the installation instructions in the release notes.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;If you are using any version of the JDK from 1.1 on, the JDBC API is already included, and you should not download the JDBC 1.22 API.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;17. How do I retrieve a whole row of data at once, instead of calling an individual ResultSet.getXXX method for each column?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;The ResultSet.getXXX methods are the only way to retrieve data from a ResultSet object, which means that you have to make a method call for each column of a row. It is unlikely that this is the cause of a performance problem, however, because it is difficult to see how a column could be fetched without at least the cost of a function call in any scenario. We welcome input from developers on this issue.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;18. Why does the ODBC driver manager return 'Data source name not found and no default driver specified Vendor: 0'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;This type of error occurs during an attempt to connect to a database with the bridge. First, note that the error is coming from the ODBC driver manager. This indicates that the bridge-which is a normal ODBC client-has successfully called ODBC, so the problem isn't due to native libraries not being present. In this case, it appears that the error is due to the fact that an ODBC DSN (data source name) needs to be configured on the client machine. Developers often forget to do this, thinking that the bridge will magically find the DSN they configured on their remote server machine&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;19. Are all the required JDBC drivers to establish connectivity to my database part of the JDK?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;No. There aren't any JDBC technology-enabled drivers bundled with the JDK 1.1.x or Java 2 Platform releases other than the JDBC-ODBC Bridge. So, developers need to get a driver and install it before they can connect to a database. We are considering bundling JDBC technology- enabled drivers in the future.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;20. Is the JDBC-ODBC Bridge multi-threaded?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;No. The JDBC-ODBC Bridge does not support concurrent access from different threads. The JDBC-ODBC Bridge uses synchronized methods to serialize all of the calls that it makes to ODBC. Multi-threaded Java programs may use the Bridge, but they won't get the advantages of multi-threading. In addition, deadlocks can occur between locks held in the database and the semaphore used by the Bridge. We are thinking about removing the synchronized methods in the future. They were added originally to make things simple for folks writing Java programs that use a single-threaded ODBC driver.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;21. Does the JDBC-ODBC Bridge support multiple concurrent open statements per connection?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;No. You can open only one Statement object per connection when you are using the JDBC-ODBC Bridge.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;22. Does the JDBC-ODBC Bridge developed by Merant and Sun support result sets that contain Japanese Characters (DBCS)?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Yes, but we haven't tested this ourselves. The version of the Bridge in the Java 2 SDK, Standard Edition, and Java 2 SDK, Enterprise Edition, also supports a new charSet Connection property for specifying the character encoding used by the underlying DBMS.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;23. Why can't I invoke the ResultSet methods afterLast and beforeFirst when the method next works?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;You are probably using a driver implemented for the JDBC 1.0 API. You need to upgrade to a JDBC 2.0 driver that implements scrollable result sets. Also be sure that your code has created scrollable result sets and that the DBMS you are using supports them.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;24. How can I retrieve a String or other object type without creating a new object each time?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Creating and garbage collecting potentially large numbers of objects (millions) unnecessarily can really hurt performance. It may be better to provide a way to retrieve data like strings using the JDBC API without always allocating a new object.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;We are studying this issue to see if it is an area in which the JDBC API should be improved. Stay tuned, and please send us any comments you have on this question.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;25. There is a method getColumnCount in the JDBC API. Is there a similar method to find the number of rows in a result set?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;No, but it is easy to find the number of rows. If you are using a scrollable result set, rs, you can call the methods rs.last and then rs.getRow to find out how many rows rs has. If the result is not scrollable, you can either count the rows by iterating through the result set or get the number of rows by submitting a query with a COUNT column in the SELECT clause.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;26. I would like to download the JDBC-ODBC Bridge for the Java 2 SDK, Standard Edition (formerly JDK 1.2). I'm a beginner with the JDBC API, and I would like to start with the Bridge. How do I do it?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;The JDBC-ODBC Bridge is bundled with the Java 2 SDK, Standard Edition, so there is no need to download it separately.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;27. If I use the JDBC API, do I have to use ODBC underneath?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;No, this is just one of many possible solutions. We recommend using a pure Java JDBC technology-enabled driver, type 3 or 4, in order to get all of the benefits of the Java programming language and the JDBC API.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;28. Once I have the Java 2 SDK, Standard Edition, from Sun, what else do I need to connect to a database?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;You still need to get and install a JDBC technology-enabled driver that supports the database that you are using. There are many drivers available from a variety of sources. You can also try using the JDBC-ODBC Bridge if you have ODBC connectivity set up already. The Bridge comes with the Java 2 SDK, Standard Edition, and Enterprise Edition, and it doesn't require any extra setup itself. The Bridge is a normal ODBC client. Note, however, that you should use the JDBC-ODBC Bridge only for experimental prototyping or when you have no other driver available.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3513789510947098583-5623718126493979637?l=learningjava-aman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningjava-aman.blogspot.com/feeds/5623718126493979637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learningjava-aman.blogspot.com/2009/08/jdbc-odbc-questions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/5623718126493979637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3513789510947098583/posts/default/5623718126493979637'/><link rel='alternate' type='text/html' href='http://learningjava-aman.blogspot.com/2009/08/jdbc-odbc-questions.html' title='JDBC - ODBC Questions......'/><author><name>Aman</name><uri>http://www.blogger.com/profile/03773653410891253027</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_diNGa3MkxCw/SqcDfOOm22I/AAAAAAAAAFI/-tCtENbzY0s/S220/aman+surat+(101).JPG'/></author><thr:total>0</thr:total></entry></feed>
