Home Answers Viewqa Java-Beginners how to implements jdbc connections using awt

 
 


subbareddy vajrala
how to implements jdbc connections using awt
1 Answer(s)      a year and 9 months ago
Posted in : Java Beginners

sir, My name is subbareddy vajrala.I want to implement small project on awt.so please give me your valuable information about how to implements jdbc connections in awt.please give me sample example awt with jdbc.

                 Thanking you sir.
View Answers

August 18, 2011 at 3:06 PM


import java.awt.*;
import java.sql.*;
import javax.swing.*;
import java.awt.event.*;

class  FormData{
    public static void main(String[] args){
    Frame f=new Frame();
    Label label1=new Label("First Name: ");
    Label label2=new Label("Last Name: ");
    Label label3=new Label("Email: ");
    Label label4=new Label("Address: ");
    Label label5=new Label("Contact No: ");
    final TextField text1=new TextField(20);
    final TextField text2=new TextField(20);
    final TextField text3=new TextField(20);
    final TextField text4=new TextField(20);
    final TextField text5=new TextField(20);
    Button b=new Button("Save");
    b.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e){
        String v1=text1.getText();
        String v2=text2.getText();
        String v3=text3.getText();
        String v4=text4.getText();
        String v5=text5.getText();
        try{
           Class.forName("com.mysql.jdbc.Driver");
           Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/roseindia", "root", "root");
           Statement st=con.createStatement();
           int i=st.executeUpdate("insert into student(firstname,lastname,email,address,telephone) values('"+v1+"','"+v2+"','"+v3+"','"+v4+"','"+v5+"')");
           JOptionPane.showMessageDialog(null,"Data is inserted successfully");
        }
        catch(Exception ex){
        System.out.println(ex);
         }
       }
        });
        Panel p=new Panel(new GridLayout(6,2));
        p.add(label1);
        p.add(text1);
        p.add(label2);
        p.add(text2);
        p.add(label3);
        p.add(text3);
        p.add(label4);
        p.add(text4);
        p.add(label5);
        p.add(text5);
        p.add(b);
        f.add(p);
        f.setVisible(true);
        f.pack();
    }
}

For more information, please go through the following link:

AWT Examples









Related Pages:
how to implements jdbc connections using awt
how to implements jdbc connections using awt  sir, My name... valuable information about how to implements jdbc connections in awt.please give me sample example awt with jdbc. Thanking you sir.  
how to implements jdbc connections using awt?
how to implements jdbc connections using awt?   My name is Aditya... information about how to implements jdbc connections in awt.please give me sample example awt with jdbc.   We are proving you a simple application
jdbc connections
jdbc connections  How can I coonect with oracle9i with java program using both thin driver and sun driver. plz send sample code for both the drivers... oracle.sql.*; 2) Load and Register the JDBC driver: DriverManager.registerDriver
awt
JDBC in awt  how to display data using JDBC in awt/applet
awt
JDBC and AWT to display data  how to display data using JDBC in awt/applet
awt
JDBC in awt applet  how to display data using JDBC in awt/applet
awt
Java AWT Applet example  how to display data using JDBC in awt/applet
Connections with MicroSoft SQL - JDBC
Connections with MicroSoft SQL  How to Connect Java and MS SQL?? Actually i used below code i got SQLException and class not found... import...; Statement st = null; ResultSet rs = null; String url = "jdbc
Interact with connection pools to obtain and release connections
within a transaction, using unshared connections can lead to deadlocks... in an invalid handle exception: A component using shareable connections... and release connections Prev Chapter 4. Demonstrate understanding
AWT Tutorials
AWT Tutorials  How can i create multiple labels using AWT????   Java Applet Example multiple labels 1)AppletExample.java: import... java.awt.event.*; public class AppletExample extends Applet implements ActionListener
JDBC Versions
using Rowset technology. Features of the JDBC 2.1 core API. 1... JDBC Versions       1). The JDBC 1.0 API. 2). The JDBC 1.2 API
another frame by using awt or swings
another frame by using awt or swings  how to connect one frame to another frame by using awt or swings
swing with jdbc - Swing AWT
have some problems with swing using jdbc. 1. the values entered in table are not stored in DB. 2. is there is any solution that uses jtable with JDBC? kindly...swing with jdbc  Hi, i m developing the desktop application using
awt in java
awt in java  using awt in java gui programming how to false the maximization property of a frame
how to print all colors using awt
how to print all colors using awt  how to print all colors using awt
How to put the logo in login form using swings/awt?
How to put the logo in login form using swings/awt?  Hi, How to put the logo in login form using swings/awt? I write the login form is working...("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc
AWT
AWT  How to set size of button in awt
httpd.conf max connections
httpd.conf max connections  Hi, How to increase the MaxClients value... connections? Thanks   Hi, You can add following configuration in httpd.conf file to increase the number of connections to be handled by apache server
awt jdbc
awt jdbc  programm in java to accept the details of doctor (dno,dname,salary)user & insert it into the database(use prerparedstatement class&awt
JDBC Training, Learn JDBC yourself
JDBC Connection Pooling Accessing Database using Java and JDBC Learn how to access database using JDBC.   Enhanced SQL Exception Handling... other with keys.    Using WHERE Clause in JDBC Where
awt - Swing AWT
market chart this code made using "AWT" . in this chart one textbox when user... the chart. for this proses i whant how to send text from list to text box . i.../java/awt/ Thanks
jdbc question - JDBC
jdbc question   Up to now i am using just connection object for jdbc... connections maintained by the database. This results connections can be reused... a database connection for each user. In JDBC connection pool, a pool of Connection
jdbc question - JDBC
jdbc question   Up to now i am using just connection object for jdbc... connections maintained by the database. This results connections can be reused... a database connection for each user. In JDBC connection pool, a pool of Connection
swing/awt - Swing AWT
swing/awt  How to create richtexteditor using swings...?I'm very much new to swings....It's urgent.....Thank u...   hello read this book you get idea; JFC Swing Tutorial, The: A Guide to Constructing GUIs, Second
java swing - Swing AWT
java swing  how to save data in sql 2005 while insert... java.awt.event.*; public class InsertData extends JFrame implements ActionListener...("com.mysql.jdbc.Driver"); Connection connect =DriverManager.getConnection("jdbc:mysql
Java AWT Package Example
will learn how to handle events in Java awt. Events are the integral part... This program shows you how to create a frame in java AWT package... how to handle events in java awt. Here, this is done through the java.awt.
jdbc
how can we call stored procedure using jdbc  how can we call stored procedure using jdbc   Call a Stored Procedure using...(); For more information, visit the following link: JDBC call Stored Procedure
java-swings - Swing AWT
java-swings  How to move JLabel using Mouse? Here the problem is i... at runtime by moving labels using mouse. Plz tell me the correct way to solve... implements MouseMotionListener { private int xaxis, yaxis; public
JDBC-AWT
JDBC-AWT  I can not able to capture the data in an applet which contains the components like text fields,check box etc.. and i am trying to save the data in sql+. When i run the code in netbeans, i can abe to store successfully
JFileChooser - Swing AWT
JFileChooser  Hi,iam using jfilechooser to select a directory....now... directory one by one...........can any one plzzzz assist me how to read the sub...*; import java.util.*; public class FileChooser extends JPanel implements
JList - Swing AWT
JList  May i know how to add single items to JList. What... add element at runtime using listModel.addElement(Object obj... javax.swing.event.*; public class SingleList extends JPanel implements
how to create a text box using awt
how to create a text box using awt  give an example how creat multi buttons & text boxes
Java Program - Swing AWT
a JPG Image and After Loading it Saves that Image using JFileChooser  Hi... = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root...(Exception ex){} } } class ImageCellRenderer extends JLabel implements
JDBC
retrieve the value from database into dropdown list using JDBC SQL 2005  How to retrieve the value from database into dropdown list using JDBC &...").newInstance(); String connectionURL = "jdbc:mysql://localhost:3306/test";; Connection
JDBC
JDBC  How you fetch the data between 4 tables using join? Which type of join you have using here
AWT
AWT  How to set size of button
jdbc
how can we do batch updates using callablestatement interface  how can we do batch updates using callablestatement interface   The batch update is the ability to process more than one statement
jdbc
jdbc  how can i store the image file and retrive the images from the database using java with querys also   import java.sql.*; import... = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root
Swing and AWT Problem - Swing AWT
Swing and AWT Problem  hi sir i have a problem i know from one Jframe... ButtonListener implements ActionListener { PrinterJob printJob; PageFormat...); } } class PrintableCanvas implements Printable { DrawingCanvas canvas
displaying image in awt - Java Beginners
to display image using awt from here and when I execute the code I am getting... ActionListener{ JFrame fr = new JFrame ("Image loading program Using awt"); Label... g.drawImage(image,20,45,this); How can I solve this problem. Thanks
maximum limit of database connections have been reached.
maximum limit of database connections have been reached.  How do I check in my code whether a maximum limit of database connections have been reached
maximum limit of database connections have been reached.
maximum limit of database connections have been reached.  How do I check in my code whether a maximum limit of database connections have been reached
JDBC using Spring framework - JDBC
JDBC using Spring framework  Hi, I am using Spring framework in my project. I am making a call to the DB2 procedure using datasource and it returns... the code i'm using... HashMap params = new HashMap(); params.put("Username
jdbc - JDBC
jdbc  Hi.. i am running the servlet program with jdbc connections in this porgram i used two 'esultset' objects.. in this wat ever coding.... now in this same program i am want to do same thing using second resultset
jdbc - JDBC
management so i need how i can connect the pgm to database by using jdbc...? if u replyed its very useful for me...  Hi, Please read JDBC tutorial at http://www.roseindia.net/jdbc/jdbc-mysql/ Thanks   Hi, You
How to passed the ID's in MAP how to stored whaterver select the name that only ID should store in db using SWING/AWT?
How to passed the ID's in MAP how to stored whaterver select the name that only ID should store in db using SWING/AWT?  Hi, I am working on SWING/AWT application,I write select box programs in swings. my proble is what
how to connection jsp to oracle database connections in netbeans ide
how to connection jsp to oracle database connections in netbeans ide  how to connect jsp to oracle database connections in netbeans ide?pls provide screenshots if possible
how to connection jsp to oracle database connections in netbeans ide
how to connection jsp to oracle database connections in netbeans ide  how to connect jsp to oracle database connections in netbeans ide?pls provide screenshots if possible
How to use KeyListener
How to use KeyListener        Introduction  In this section, you will learn how to handle different key events on the Java Awt component by using the event handling
jdbc - JDBC
through the application. my doubts are, 1)how to create table with n number of columns even the developer don't know how many columns,(using java script new text... in JSP to create a table. 2)how desc can be written in JDBC concepts  

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.