Home Answers Viewqa JDBC jdbc front end

 
 


maria
jdbc front end
1 Answer(s)      3 years ago
Posted in : JDBC

a code written using JDBC,ODBC,SQL and swing only that allows the user to select the required driver related to a specific database that can execute the SQL queries related to that database.
View Answers

June 10, 2010 at 1:10 PM


Hi Friend,

Try the following code:

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

class FormDemo extends JFrame {
JButton ADD;
JPanel panel;
JFrame f;

FormDemo(){
JLabel label1,label2;
final JTextField text1,text2;
label1 = new JLabel();
label1.setText("Name:");
text1 = new JTextField(20);

label2 = new JLabel();
label2.setText("Address:");
text2 = new JTextField(20);

ADD=new JButton("Insert");
ADD.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
String v1=text1.getText();
String v2=text2.getText();
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection connect =DriverManager.getConnection("jdbc:odbc:access","","");
Statement st=connect.createStatement();
int i=st.executeUpdate("insert into data(name,address) values('"+v1+"','"+v2+"')");
JOptionPane.showMessageDialog(null,"Inserted Successfully");
}
catch(Exception ex){
JOptionPane.showMessageDialog(null,"Error");
}

}
});
f=new JFrame();
panel=new JPanel(new GridLayout(3,2));
panel.add(label1);
panel.add(text1);
panel.add(label2);
panel.add(text2);
panel.add(ADD);
f.add(panel,BorderLayout.CENTER);
f.setTitle("FORM");
f.setVisible(true);
f.pack();
}
public static void main(String[]args){
FormDemo ff=new FormDemo();
}
}

If you haven't created DSN connection then follw these steps:

1. Open Data Sources (Start->Control Panel->Administrative

Tool->Data Sources(ODBC)

2. Open User DSN tab
3. Add a user DSN
4. Select Microsoft Access Driver(*.mdb)
5. Select database name and Create the DSN name (e.g emp)
6. Click "Ok" and then restart your compiler.

Thanks









Related Pages:
jdbc front end - JDBC
jdbc front end  a code written using JDBC,ODBC,SQL and swing only that allows the user to select the required driver related to a specific database..."); Connection connect =DriverManager.getConnection("jdbc:odbc:access","",""); Statement st
CONNECT TO FRONT END - Hibernate
CONNECT TO FRONT END  HI HOW TO COONECT HIBERNET WITH STRUCT FRONT eND. PLEASE PROVIDE CODE AS SOON AS POSSIBLE. REGARDS DILEEP  Hi Friend, Please visit the following link: http://www.roseindia.net/struts
extract data fom table when a button is clicked in front end page using mysql5.0 and tomcat6.0
extract data fom table when a button is clicked in front end page using... is stored in mysql5.0 databse, when a button is clicked in front end page using...://www.roseindia.net/jdbc/display-data-database.shtml Thanks
front-end validation based on the xml in validation.xml.
front-end validation based on the xml in validation.xml.  How you will enable front-end validation based on the xml in validation.xml
How to get the data from the database (Oracle) in console or in ie using servlet or jsp as Front end
How to get the data from the database (Oracle) in console or in ie using servlet or jsp as Front end  hello i have a simple problem in jsp...("sun.jdbc.odbc.JdbcOdbcDriver"); con=DrivergetConnection("jdbc:odbc:DNSName","scott
How we delete a data of database from front end jsp page
How we delete a data of database from front end jsp page   I make a website and featch a data from data base and now i want that a delete button put in front of a featched data and when i clicked on this button then the data
not picking request parameters from the front end - JSP-Servlet
you have enter in front end). but i am getting response as welcome to unicel...not picking request parameters from the front end  hi, This is venkatramana. I am writing one small basic program. I am not getting proper output
jdbc
is to reduce the network calls between the front end application and its database rather...jdbc define batch updates  define batch updates?exp   JDBC... links: http://www.roseindia.net/jdbc/Jdbc-batch-update.shtml http
JDBC batch
to interact your Java Application in your front end with the backend... Connection provides you to connect  the front end in java application... JDBC batch       JDBC is simply a Java
JDBC access database
JDBC access database       JDBC is a Java Database Connectivity. The JDBC Connectivity provides API classes and interfaces for connecting the front end in Java application with database connections
MySQL Front
with the MySQL database. Here is the list of MySQL Front end tools: What...    MySQL-Front is a front-end interface for the popular MySQL...-datasources.    Introducing SQLyog and a MySQL Front End
jdbc - JDBC
jdbc  How can i store images in a database column without a front end...: http://www.roseindia.net/jdbc/save_image.shtml Retrieve Image using Java... = DriverManager.getConnection( "jdbc:mysql://localhost:3306/test", "root", "root
i have developed the application in jsp(front-end -jsp,business logic-jsp).it is very slow when accessing the page - JSP-Servlet
i have developed the application in jsp(front-end -jsp,business logic-jsp).it is very slow when accessing the page  i have developed the application in jsp only.i did not use any classes.application is very slow when access
How Insert DateTime Vales into Mysql Databse from the front end application.But User Gives Date only from Datepicker,not Time
How Insert DateTime Vales into Mysql Databse from the front end application.But User Gives Date only from Datepicker,not Time  I am new developer in .net,I Have requirement..like this ,when user pick date from date picker
How Insert DateTime Vales into Mysql Databse from the front end application.But User Gives Date only from Datepicker,not Time
How Insert DateTime Vales into Mysql Databse from the front end application.But User Gives Date only from Datepicker,not Time  I am new developer in .net,I Have requirement..like this ,when user pick date from date picker
project - JDBC
project  code for front-end of any JDBC compatible database  Hi Friend, Try the following code: 1)register.jsp: Registration Form First Name: Last Name: User Name: Password: Address
JDBC Training, Learn JDBC yourself
your Java Application in your front end with the backend.   .... The JDBC Connectivity provides API classes and interfaces for connecting the front end in Java application with database connections.    JDBC
jdbc & sql related project - JDBC
jdbc & sql related project  code using jdbc,odbc,swing,MySql classes to create front-end of any jdbc that allows the user to select any database... = DriverManager.getConnection("jdbc:mysql://localhost:3306", "root", "root
Help on JSP - JDBC
Help on JSP  Sir I am makeing a project name Online reservation and Enquiry system. I had completed the front end design with the help of html,delete...;jdbc:oracle:thin@localhost:1521:xe","scot","tiger"
front controller - JSP-Servlet
front controller  How to implement front controller in a web application
regarding java - JDBC
done front end work using swing and AWT concepts of java i am using mysql as back end and i have also configured java with mysql i am using three table... this or tell me if there is another way out    Hi friend, Use JDBC i
jdbc,odbc,MySQL,swing - Java Beginners
to the selected database driver.It is very well known as jdbc front end of a database...jdbc,odbc,MySQL,swing  write a code that displays a menu list of all available database drivers in a window,and allows the user to select any driver
hibernate criteria MatchMode END Example
hibernate criteria MatchMode END Example In this Example, We will discuss... for matching strings using "ilike". The MatchMode.END match the end...;>jdbc:mysql://localhost:3306/test</property> <property name="
JDBC connection
JDBC connection       The JDBC connection implements a connection with database in front end application... the front end in java application(url) and backend. The catch block is responsible
JDBC Next
the front end and back end database. Loading a driver is the next step... JDBC Next       The Tutorial help in understanding JDBC Next. The program describe a code
regarding connectivity program only - JDBC
use html in front end ...that there r options like 1.name---------- 2.sub1... end data base using sql quires ... when i click the button total i should get
regarding connectivity program only - JDBC
use html in front end ...that there r options like 1.name---------- 2.sub1... end data base using sql quires ... when i click the button total i should get... = "jdbc:mysql://192.168.10.211:3306/"; String db = "amar"; String driver
java &ms access - JDBC
for a food festival using Java swing as front end and MS access as Backend... = DriverManager.getConnection("jdbc:odbc:access"); Statement st...("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con =DriverManager.getConnection("jdbc:odbc
JDBC ConnectionUrl
; The JDBC Connection Url is the mean of connecting  a front end application...; the Java front end application to the backend database. In case the exception... is established ,your front-end application is able to interact with backend database
java servlet programming - JDBC
the server by clicking the checkboxes(there is one checkbox in front of every file... " + i +". " + byteCnt + " bytes"); }// end for(i) outputing files byte
JDBC Fetch
a network interface helps you in communicating between the front end Java application... JDBC Fetch       The Tutorial... we want to describe you an example from Jdbc Fetch. In this program code
JDBC autocommit
name as an argument. As  driver is loaded ,you connect the front end... JDBC autocommit       JDBC connection... In this Tutorial we want to describe you a code that helps in understanding JDBC auto commit
JDBC Exception
network interface to communicate between front end and back end  application... JDBC Exception      ... the execution of program. Exception Occurred in JDBC Connectivity when a connection
JDBC Prepared Statement Addbatch
interface enables you to communicate between front end -back end database.2... JDBC Prepared Statement Addbatch       The code illustrate an example from JDBC Prepared statement
JDBC Connectivity - JDBC
JDBC Connectivity  my question is how to connect a Java program... String filename = "d:/java/mdbTEST.mdb"; String database = "jdbc...+= filename.trim() + ";DriverID=22;READONLY=true}"; // add on to the end
JDBC-Odbc Connectivity
between front-end application in java and database in the backend.  ... JDBC-ODBC Connectivity       The code illustrates an example from JDBC-ODBC
JDBC Prepared Statement Insert
that enables you to communicate between front end application in java and database... JDBC Prepared Statement Insert       The Tutorial illustrates a program in JDBC Prepared
JDBC Functions
that provides you network interface for communicating between the front end java... JDBC Functions       In this Tutorial we want to describe you a code that helps you easy to understand Jdbc Functions
jdbc mysqll - JDBC
jdbc mysqll  import java.sql.*; public class AllTableName{ public...("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql...(DriverManager.java:171) at AllTableName.main(AllTableName.java:11) ** END
jdbc mysql - JDBC
jdbc mysql  import java.sql.*; public class AllTableName...=DriverManager.getConnection("jdbc:mysql://localhost:3306/ram","root","root...) at AllTableName.main(AllTableName.java:11) ** END NESTED EXCEPTION ** Last packet
JDBC Drive For Mysql
. Once the driver is loaded ,you connect the front end of the Java application... JDBC Drive For Mysql       In this Tutorial we want to describe you a code that help you in understanding JDBC Drive
can't connect to MySQL Server(10060) - JDBC
MySQL front end. Can we connect to the MySQL server using the I.P address... information. http://www.roseindia.net/jdbc/ Thanks
JDBC batch update
of batch is to reduce the network calls between the front end application... provides network interface to communicate between front end and back end. Loading...( ).This help you in establishing a connection between the front end -backend
JDBC Prepared Statement Update
interface, that enables you to communicate between front end application -back end... JDBC Prepared Statement Update   ... in SQL updates the existing records in a table. In JDBC the Prepared
JDBC Prepared statement Close
front-end application and database. Inside the main( ) method, we have a try... JDBC Prepared statement Close     ... an example from JDBC Prepared Statement Close. In this program, the code describe how
JDBC Get Metadata
network interface between front end application and backend database.   ... JDBC Get Metadata       JDBC Get Metadata is the collective data structure, data type
Jdbc Mysql Connection String
* - This provides you a network interface that communicate between  front end... JDBC Mysql Connection String   ... you to understand JDBC MysqlConnection String. The code include a class 
JDBC Execute Query
as driver class.When a driver is loaded, you connect the front end of your Java... JDBC Execute Query       The  Execute Query in JDBC retrieve the elements from a database. In this Tutorial we
Front Page Web Hosting
Front Page Web Hosting Microsoft Front Page is leading WYSIWYG editor for the development of web site using HTML and DHTML. Front Page is used... providers provides Front Page Support on their web servers. Front Page extensions