JDBC with access as backend

Ads
 

JDBC with access as backend

Jdbc connectivity in java to MS Access for retrieving data between two dates

View Answers

August 9, 2012 at 6:06 PM

Here is an example that fetches data between two dates from MS access database.

import java.sql.*;

class FetchDataBetweenTwoDates 
{
    public static void main(String[] args) 
    {
        try{
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection con = DriverManager.getConnection("jdbc:odbc:roseindia");
        Statement st=con.createStatement();
        String d1 = "2/22/2006";
        String d2 = "3/20/2007";
        String query = "Select * from employee where dateOfJoining >=to_date(d1,'dd/mm/yyyy') and dateOfJoining <=to_date(d2,'mm/dd/yyyy')"; 
        ResultSet rs=st.executeQuery(query);
        while(rs.next()){
            System.out.println(rs.getString("name")+"\t "+rs.getString("address"));
        }
        }
        catch(Exception e){
        System.out.println(e);
        e.printStackTrace();
        }
    }
}

Ads









Related Tutorials/Questions & Answers:
JDBC with access as backend
JDBC with access as backend  Jdbc connectivity in java to MS Access... data between two dates from MS access database. import java.sql.*; class... con = DriverManager.getConnection("jdbc:odbc:roseindia"); Statement st
Jdbc MS-Access question
Jdbc MS-Access question  How to delete records from the three table in MS-Access? They are in relationship with each other regarding to data field
Advertisements
Jdbc MS-Access question
Jdbc MS-Access question  How to delete records from the three table in MS-Access? They are in relationship with each other regarding to data field
stock checking in java with backend as access
stock checking in java with backend as access  Hi, I am doing a project in java,Can i able to know how to check the stock availability of a product in java...my back end connectivity is ms-access from the database ,i hv
JDBC access database
JDBC access database       JDBC is a Java Database Connectivity. The JDBC Connectivity provides API classes... that helps in understanding JDBC access database. The code illustrates the list
JDBC
JDBC       JDBC stands for Java Data Base Connectivity that defines how a client may access a database... Connectivity (JDBC) API is the industry standard for database-independent
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
jdbc
jdbc  how to update int values of ms-access in jdbc program?   In MS Access database, use Number data type for int values. import... =DriverManager.getConnection("jdbc:odbc:access","",""); Statement st=null; st
Video Tutorial: How to access MySQL through JDBC?
How to access MySQL through JDBC? The interface that is used to access... of "How to Access MySQL through JDBC?": In the JAR selection window... run as option. If successful, you can now access Mysql through JDBC. You
online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.
online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.  please provide online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.   Create table test
jdbc
of ms-access using java application i want to perform both operations of ms-access using jdbc connection   import java.sql.*; public class CreateTable... = DriverManager.getConnection("jdbc:odbc:student"); Class.forName
jdbc
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... connectivity in short   Java MS Access database connectivity
JDBC
JDBC  why we use batch in jdbc
jdbc
jdbc  display the records using index in jdbc
jdbc
jdbc  Hai , Give a steps for jdbc connectivity
jdbc
what are different type of locks  what are different type of locks   Types of locks in JDBC: Row and Key Locks:: It is useful when... Lock: In order to prevent the read or update access from other transactions when
JDBC
JDBC  How to add set of queries in a single query in JDBC
jdbc
jdbc   how to write program to save data and retrieve data from the form in Java
jdbc
jdbc  why do we need to load jdbc drivers before connecting to database
JDBC
JDBC  how to set classpath for eclipse, java, where to copy jdbc connector
JDBC
JDBC  in class.forname which driver name we are writing for the connection from jdbc to sqlserver 2008
jdbc
jdbc  is it possible to use doget & dopost method with jdbc to call in a servlet programe
Jdbc
Jdbc  A java program with jdbc connectivity with insert,delete,update options for name,regno,mark1,mark2,total
JDBC
JDBC  can u send me the code of jdbc how to join two tables that are in relation
jdbc
jdbc define batch updates  define batch updates?exp   JDBC... links: http://www.roseindia.net/jdbc/Jdbc-batch-update.shtml http://www.roseindia.net/tutorial/java/jdbc/batchupdateresultsetexample.html
How to Access MS Access in jar.
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 Access MS Access in jar.  how do i access my Ms-Access file
jdbc
jdbc  Write a web based student registration application where the students can register online with their enrollment no. You are required to use JSP, Servelet and JDBC
jdbc
with allowing multiple people simultaneous access to shared entities. Lock In database, a lock is used to access a database concurrently for multiple users... exclusive access to the record until the lock is released
JDBC
JDBC save a data in the database  I need a code to save a data... between java and mysql using JDBC and saves the data into the database. import... con = null; String url = "jdbc:mysql://localhost:3306/"; String db
JDBC
JDBC code to save a data in the database  I need a code to save... the connection between java and mysql using JDBC and saves the data into the database...!"); Connection con = null; String url = "jdbc:mysql://localhost:3306/"; String db
jdbc
how can we set transaction level through jdbc api  how can we set transaction level through jdbc api   Use Connection.setTransactionIsolation(int) to set the desired tansaction level, which takes one of the 5 arguments

Ads