Skip to main content

Posts

Showing posts with the label Java and Servlets

Whate is Java Servlets ,JDBC,JAVA API,Webserver

WHAT IS JAVA SERVLETS ? An HTTP servlet can generate an HTML page, either when the servlet is accessed explicitly by name, by following a hypertext link, or as the result of a form submission. An HTTP servlet can also be embedded inside an HTML page, where it functions as a server-side include. Servlets can be chained together to produce complex effects--one common use of this technique is for filtering content. Finally, snippets of servlet code can be embedded directly in HTML pages using a new technique called JavaServer Pages. Servlets : A servlet is dynamically loaded module that services requests from Web server, by another service called response. Servlet is efficient as it is initialized only once when the web server loads it. Servlets are efficient, persistent, portable, robust, extensible, and secure, and they have facility to embed JavaScript. JDBC :  The JDBC is a pure JAVA API used to execute SQL statements. It provides the classes and interfaces that can be us

Java Archive files

Java Archive files allow developers to package many classes into a single file. JAR files also use compression, so this can make applets and applications smaller. Creating a .JAR file is easy. Simple go to the directory your classes are stored in and type :- jar -cf myfile.jar *.class If your application or applet uses packages, then you'll need to do things a little differently. Suppose your classes were in the package mycode.games.Cool Game - you'd change to the directory above mycode and type the following :- jar -cf myfile.jar .\mycode\games\CoolGame\*.class Now, if you have an existing JAR file, and want to extract it, you'd type the following jar -xf myfile.jar Working with JAR files isn't that difficult, especially if you've used the UNIX 'tar' command before. If you're planning on packaging an applet for Internet Explorer, or an application for Microsoft's jview, you might also want to consider .CAB files.

Java Code Menu And Menu Items

Java Code Menu And Menu Items import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.io.*; import javax.swing.SwingUtilities; import javax.swing.undo.*; class MyMenu1 implements ActionListener { JFrame f; JMenuBar menubar; JMenu menu,submenu; JMenuItem menuitem; JRadioButtonMenuItem rbmt; JCheckBoxMenuItem cbmt; JTextArea ta; DataInputStream dis; JFileChooser fc,fc1; String record=null; JScrollPane sp; protected UndoManager undo; MyMenu1() { f=new JFrame("my notepad"); f.setBounds(0,0,1200,1000); menubar=new JMenuBar(); ta=new JTextArea(); ta.setEditable(true); int v=JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED;int h=JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED; sp=new JScrollPane(ta,v,h); sp.setVerticalScrollBarPolicy(v); sp.setHorizontalScrollBarPolicy(h); sp.setBounds(0,30,1130,750); sp.setVisible(true); f.add(sp); undo=new UndoManager(); //file menu menu=new JMenu("File"); m