<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>vectors Archives -</title>
	<atom:link href="https://mitindia.in/tag/vectors/feed/" rel="self" type="application/rss+xml" />
	<link>https://mitindia.in/tag/vectors/</link>
	<description></description>
	<lastBuildDate>Fri, 08 Jul 2016 05:51:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://mitindia.in/wp-content/uploads/2023/03/cropped-android-chrome-512x512-1-32x32.png</url>
	<title>vectors Archives -</title>
	<link>https://mitindia.in/tag/vectors/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>JDBC Example using Forms</title>
		<link>https://mitindia.in/jdbc-example-using-forms/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Mon, 04 Jul 2016 13:18:55 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[hashmap]]></category>
		<category><![CDATA[java program without main()]]></category>
		<category><![CDATA[jdbc]]></category>
		<category><![CDATA[vectors]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=221</guid>

					<description><![CDATA[<p>JDBC Program to Insert a record to database using Forms. import javax.swing.*; import java.awt.*; import java.io.*; import java.awt.event.*; import java.sql.*; class Form extends JFrame { JButton ADD; JPanel panel; JLabel label1,label2,label3,label4,label5; final JTextField text1,text2,text3,text4,text5; Form() { label1 = new JLabel(); label1.setText("UserID:"); text1 = new JTextField(20); label2 = new JLabel(); label2.setText("First Name:"); text2 = new JTextField(20); [&#8230;]</p>
<p>The post <a href="https://mitindia.in/jdbc-example-using-forms/">JDBC Example using Forms</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>JDBC Program to Insert a record to database using Forms.</p>
<pre>import javax.swing.*;
import java.awt.*;
import java.io.*;
import java.awt.event.*;
import java.sql.*;

class Form extends JFrame
{
JButton ADD;
JPanel panel;
JLabel label1,label2,label3,label4,label5;
final JTextField text1,text2,text3,text4,text5;

Form()
{
label1 = new JLabel();
label1.setText("UserID:");
text1 = new JTextField(20);

label2 = new JLabel();
label2.setText("First Name:");
text2 = new JTextField(20);

label3 = new JLabel();
label3.setText("Last Name:");
text3 = new JTextField(20);

label4 = new JLabel();
label4.setText("ADDRESS:");
text4 = new JTextField(20);

label5 = new JLabel();
label5.setText("Salary:");
text5 = new JTextField(20);

ADD=new JButton("ADD");

panel=new JPanel(new GridLayout(6,2));
panel.add(label1);
panel.add(text1);
panel.add(label2);
panel.add(text2);
panel.add(label3);
panel.add(text3);
panel.add(label4);
panel.add(text4);
panel.add(label5);
panel.add(text5);
panel.add(ADD);
add(panel,BorderLayout.CENTER);
setTitle("FORM");

setDefaultCloseOperation(EXIT_ON_CLOSE);

ADD.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae){

String value1=text1.getText();
String value2=text2.getText();
String value3=text3.getText();
String value4=text4.getText();
String value5=text5.getText();


try{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection     con = DriverManager.getConnection("jdbc:odbc:test");
Statement sta = con.createStatement(); 
sta.executeUpdate("insert into Emp_Det(userid,fname,lname, address, salary) values('"+value1+"','"+value2+"' ,'"+value3+"','"+value4+"','"+value5+"')");

            JOptionPane.showMessageDialog(null,"Inserted Successfully!");
        }
catch(Exception e){}
}
});
}
}
class FormDemo
{
public static void main(String arg[])
{
try
{
Form frame=new Form();
frame.setSize(300,150);
frame.setVisible(true);
}
catch(Exception e)
{
}
}
}</pre>
<p><a name="more"></a></p>
<p>Java Program to show Frames</p>
<pre>import javax.swing.*;

public class frame
{
public static void main(String[] args)
{
JFrame f = new JFrame("Frame in Java Swing");
f.setSize(400, 400);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 }
}</pre>
<p>Java Program to demonstrate HashMap example.</p>
<pre>import java.util.*;
public class HashMapExa 
{
public static void main(String args[]) 
{
HashMap&lt;Integer, String&gt; hmap = new HashMap&lt;Integer, String&gt;();

      hmap.put(1, "AppleIOS");
      hmap.put(2, "Windows");
      hmap.put(3, "Linux");
      hmap.put(4, "Solaris");
      hmap.put(5, "DOS");

      /* Now, Display content using Iterator*/
      Set set = hmap.entrySet();
      Iterator iterator = set.iterator();
System.out.println("List of Contents in the HashMap"); 

 while(iterator.hasNext()) 
   {
    Map.Entry mentry = (Map.Entry)iterator.next();
System.out.print("key is: "+ mentry.getKey() + " &amp; Value is: ");
         System.out.println(mentry.getValue());
      }

      /* Request values based on key*/
      String var= hmap.get(1);
      System.out.println("Value at index 1 is: "+var);

      /* Remove values based on key*/
      hmap.remove(3);
      System.out.println("Map key and values after removal:");
      Set set2 = hmap.entrySet();
      Iterator iterator2 = set2.iterator();
      while(iterator2.hasNext()) {
          Map.Entry mentry2 = (Map.Entry)iterator2.next();
          System.out.print("Key is: "+mentry2.getKey() + " &amp; Value is: ");
          System.out.println(mentry2.getValue());
       }
   }
}</pre>
<p>Java Program to demonstrate Vector with sorting records example</p>
<pre>import java.util.*;
public class VectorExa {

public static void main(String args[])
 {
      Vector&lt;String&gt; vec = new Vector&lt;String&gt;(3);

      vec.addElement("AppleIOS");
      vec.addElement("Windows");
      vec.addElement("Linux");
      vec.addElement("solaris");

      /* check size and capacity Increment of vector */
      System.out.println("Size of Vector is: "+vec.size());
      System.out.println("Capacity increment is: "+vec.capacity());


      vec.addElement("Android");
      vec.addElement("Symbian");
      vec.addElement("Bada");

      /* After inserting extra elements and capacityIncrement after insertions*/
      System.out.println("Size after addition: "+vec.size());
      System.out.println("Capacity after increment is: "+vec.capacity());

      /*Display Vector elements*/
      Enumeration en = vec.elements();
      System.out.println("\nElements in Vector are:");
      while(en.hasMoreElements())
         System.out.println(en.nextElement() + " ");


Collections.sort(vec);
  System.out.println("Elements in Vector after sorting :");
  for(int i=0; i &lt; vec.size(); i++)
System.out.println(vec.get(i));
   }
}</pre>
<p>Java program without using main()</p>
<pre>class WithoutMain
{
static{
System.out.println("Hello world");
System.exit(0);
}
}</pre>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fjdbc-example-using-forms%2F&amp;linkname=JDBC%20Example%20using%20Forms" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fjdbc-example-using-forms%2F&amp;linkname=JDBC%20Example%20using%20Forms" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fjdbc-example-using-forms%2F&#038;title=JDBC%20Example%20using%20Forms" data-a2a-url="https://mitindia.in/jdbc-example-using-forms/" data-a2a-title="JDBC Example using Forms"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/jdbc-example-using-forms/">JDBC Example using Forms</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
