how i can access Microsoft Access database by java program

how i can access Microsoft Access database by java program

how i can access Microsoft Access database by java program ? if any package or jar file required then please specify it. please give java source code for such database connectivity in short

View Answers

June 8, 2012 at 4:35 PM

Java MS Access database connectivity

Follow these steps:

1)Go to the start->Control Panel->Administrative Tools-> data sources.

2)Click Add button and select the driver Microsoft Access Driver(*.mdb).

3)After selecting the driver, click finish button.

4)Then give Data Source Name and click ok button.

5)Your DSN will get created.

6) Restart your compiler and compile the given code. It will create table in MS access database.

import java.sql.*;

public class CreateTable {
  public static void main(String[] args) throws Exception {
    Connection conn = DriverManager.getConnection("jdbc:odbc:student");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Statement st = conn.createStatement();
    st.executeUpdate("create table employee (empid int,empname varchar(30));");
    System.out.println("Table is created successfully!");
    st.executeUpdate("insert into employee (empid,empname ) values (1,'Roseindia')");
    System.out.println("Data is inserted successfully!");
    st.close();
    conn.close();
  }
}









Related Tutorials/Questions & Answers:
The JDBC API to access a desktop database like Microsoft Access over the network.
The JDBC API to access a desktop database like Microsoft Access over the network.  How can I use the JDBC API to access a desktop database like Microsoft Access over the network
how to access the MS ACCESS database with java
how to access the MS ACCESS database with java   how to access the MS ACCESS database with java how can we insert,delete,update,search records of ms access with java   Java MS Access database connectivity Follow
Advertisements
How can I access databse through JSP. I am using postgresql-8.4.4-1-windows as database and jboss-4.0.5.GA as server.
How can I access databse through JSP. I am using postgresql-8.4.4-1-windows as database and jboss-4.0.5.GA as server.  I am using postgresql-8.4.4-1... netbeans-6.1-ml-windows.How can I set up connection to database? Please help me
retreiving data from microsoft access database
retreiving data from microsoft access database  How can i retrieve data from microsoft access when i have select the vaules in combo box and text box. When i select these values... i want to retrieve the corresponding columns
how to access the MS ACCESS database with java - Java Beginners
how to access the MS ACCESS database with java  how can we insert,delete,update,search records of ms access with java
How To Connect MS ACCESS 2003 Database in C Program with Graphics.
How To Connect MS ACCESS 2003 Database in C Program with Graphics.  How To Connect MS ACCESS 2003 Database in C Program with Graphics
how to close the connection object,statement object,resultssetobject when using the microsoft access a database - SQL
how to close the connection object,statement object,resultssetobject when using the microsoft access a database   Hi Friend, I am developing the webapplication using the jsp(business logice-jsp).backend is microsoft access
why it is very slow when I am using the backend as microsoft access file for running the java webapplication - SQL
why it is very slow when I am using the backend as microsoft access file for running the java webapplication  I am using the backend as microsoft access file for running the java webapplication.it is very slow when twoor mor
mysql- microsoft access
mysql- microsoft access  hello, In all your tutorials, you have used Mysql. If instead of mysql i use microsoft access so how will it differ and wat will be the connection steps
JSF CONNECTION WITH MICROSOFT ACCESS
JSF CONNECTION WITH MICROSOFT ACCESS  HI CAN U PLEASE HELP ME WITH A PROGRAM WHICH SHOWS HOW TO RETRIEVE DATAS FROM MICROSOFT ACCESS.I HAD TO CREATE AN USER INTERFACE USING JSF BY CONNECTING TO MS ACCESS THANKS DEEPAK
How to access the database from JSP?
How to access the database from JSP?  Hi, What is the process... you can access the database by embedding the JDBC code. But this is not the best... database from JSP which explains you how to access the database by embedding
Please tell me how I can access a field (data type char) of resultset in a java class
Please tell me how I can access a field (data type char) of resultset in a java class  I have created a table named empdetails in postgreSql 8.4... how i can access
how to access database in applet
how to access database in applet  HI... I'm having an applet where we should display the database values in the applet... It works fine in the local... in the local system.. I created a policy file and also added that url
Use JDBC to connect Microsoft Access
Use JDBC to connect Microsoft Access  How to use JDBC to connect Microsoft Access
How to access (MySQL)database from J2ME?
How to access (MySQL)database from J2ME?  I am new to J2ME. I am using NetBeans. Can anyone help me? How to access (MySQL)database from J2ME? ( I search a lot I found that there is need to access database through servlet
How to Open Picture From M.S. Access Database using Java Servlet ?
How to Open Picture From M.S. Access Database using Java Servlet ?  ... Database But i m still not able to open this picture through Java using M.S. Access and i wants to open this Picture On Web Browser using Java Servlet anybody can
How to Store Float Value into Access Database - Java Beginners
How to Store Float Value into Access Database  Hello sir,I want to Store Student Marks Percentage into Access Database in Float Value how i can Store.... To store the double value in Access database, you need to set the datatype
Connect database in Access to Netbean?
Connect database in Access to Netbean?  how to connect database in micrsoft access to Netbean?i know it can be connected by using JDBC-ODBC bridge, can i know the steps in connecting the database? Is there any source code
How to store JComboBox selected Item into Ms Access Database - Java Beginners
How to store JComboBox selected Item into Ms Access Database  How to store JComboBox selected Item into Ms Access Database.  Hi Friend...(); } public SwingFrame(){ JFrame f = new JFrame("Frame in Java Swing
how to delete the access database value in jsp
how to delete the access database value in jsp  i loaded my database data into the dropdown list box...now i want to delete the value..plz send the source code to delete the value in dropdown list box and also from database
how to delete the access database value in jsp
how to delete the access database value in jsp  i loaded my database data into the dropdown list box...now i want to delete the value..plz send the source code to delete the value in dropdown list box and also from database
how i conditional access the data from database using combo box. - JSP-Servlet
how i conditional access the data from database using combo box.   i... appears named Subject values Arts, Commerce, Science. how i conditional access the data from database when i select class 11 0r 12. Here is JSP file
How to save JCombobox Selected Item in to Access Database - Java Beginners
How to save JCombobox Selected Item in to Access Database  How to save JCombobox Selected Item in to Access Database  Hi Friend, Try... =DriverManager.getConnection("jdbc:odbc:access","",""); Statement stmt=con.createStatement(); int i
How to insert or delete records in MS access database using jsp - JSP-Servlet
How to insert or delete records in MS access database using jsp  Hi friends please provide me a solution that i insert or delete record from a database using java server pages. I used the microsoft access 2003 database. PlZ
ACCESS DATABASE FROM HTML
ACCESS DATABASE FROM HTML  I want to access sql 2008 database in html page without help of ADODB connection.. because if access through ADODB means there is a security problem. so, Access database in html page(client side
How to Access MS Access in jar.
How to Access MS Access in jar.  how do i access my Ms-Access file... to access it via Code or is their any alter-native?? Do i need any Driver to do this ... i m able to access a Ms-access via JDBC but cant find the file wen
how to connect to MS access database in JSP?
how to connect to MS access database in JSP?  how to connect to MS access database in JSP? Any seetings/drivers need to be set or installed before... and select the driver Microsoft Access Driver(*.mdb). 3)After selecting the driver
How can I protect my database password ?
How can I protect my database password ?   How can I protect my database password ? I'm writing a client-side java application that will access a database over the internet. I have concerns about the security of the database
how to store image file and videofile in ms access database using java? - JDBC
how to store image file and videofile in ms access database using java?  how to store image file and video file in ms access database using java
Migrating sql database to Access through coding
Migrating sql database to Access through coding  How can i migrate SQL database(table) to My access through coding
Create Reports in Java with access database - Java Beginners
Create Reports in Java with access database  Hello Sir How to Create Reports of Any Type using Java when i submit data is stored in the MS access... File or any type of Report and then i want to print it. How I can Generate
Access 2007 database connectivity
Access 2007 database connectivity  i design an application form... and Exit. when i click at SAVE Button than it doesn't save the selected item from source and destination. pls tell me the code of connectivity with access 2007
link hibernate to MS ACCESS database
link hibernate to MS ACCESS database  how to link hibernate to ms access database instead of sql database
connecting to access database
connecting to access database  print("code sample");Hi I Write java projrame in notepad,I use 3 notepad pages to write this program,when i run... Add a user DSN Select Microsoft Access Driver(*.mdb) Select database name
How to access the "Add/Remove Programs" list in Control Panel using Java Program? - Java Beginners
Programs list in the Control Panel. I don't know, how can i access it? Kindly give me...How to access the "Add/Remove Programs" list in Control Panel using Java Program?  Dear Sir, I'm very interested in creating java programs
how to access the details - Java Beginners
how to access the details  how to access the detailsclass E { String name; String no;string place; E(String n,String n,String p.... Please write the program
access
access   This is Nitha Sriram i am having a problem that, i am having a combo box in the JSP page when i select an item from that i am calling the onchange function. In javascript i am getting the value now i want to pass
Problem with JRadioButton and Access Database - Java Beginners
in Access Databse, I want to store course type in to database and also other fields...Problem with JRadioButton and Access Database  Hello sir ,Here I have...(); JOptionPane.showMessageDialog(p1,"Data is successfully inserted into database."); con.close
How to Validate JRadioButton and How to Save data from JRadioButton to MS Access Database - Java Beginners
How to Validate JRadioButton and How to Save data from JRadioButton to MS Access Database  Hello Sir I want Store Corse Type that contains Two JRadioButton I want Store Information from JRadioButton to MS Access Database, and I
cannot insert data into ms access database - Java Server Faces Questions
Microsoft Access Driver(*.mdb) 5. Select database name and Create the DSN name...cannot insert data into ms access database   go back   Hi Friend, You can use the following steps for creating DSN
how to access windows registry information using java?
how to access windows registry information using java?  can any one help me how to access windows registry information using java
Applet database access - Applet
Applet database access  HI... I'm having an applet where we should display the database values in the applet... It works fine in the local system... but when its in the server, we r getting null values in the local system.. I
How to access Subclass?
How to access Subclass?  How to access subclass in java? please tell me the syntex with an example
how to control program/thread 's access authority - Security
how to control program/thread 's access authority£¿  how to control program/thread 's access authority like program can't change I/O and change system property etc.it just can't being a potential hazard. how do i
display data from a table in Access Database in a HTML page
display data from a table in Access Database in a HTML page  how to display data from a table in Access Database in a HTML page in a Java Program
How To Insert A New Record to MS Access table database in GUI
How To Insert A New Record to MS Access table database in GUI  Hello, I've been working on the actionPerformed part of my java application that involves inserting a record into a 6-column table in my MS Access database table. I'm
JSP and Database access
JSP and Database access  Hi, Please help me with the following program. I am not able to update all the pa column values in my database. csea.jsp: <html> <body> <%@page import="java.sql.*"%> <form method
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.  String sql = "UPDATE emp_details SET empEname = ?, emailId = ?, guid =?, proximityCard =?, managerEmailId = ?, reviewerEmailId
jfreechart display from access database data.
is to be done in a servlet.. Note that it is a access made database. How can I...jfreechart display from access database data.  I have made a database... to retrieve the data from the access database using prepared statement and then display
updating an access database with visual basic 2010
updating an access database with visual basic 2010  I am building a program in visual basic 2010 that connects to an access database. I... the information is entered I need it to update the information in access

Ads