regarding ms acces database and servlet

regarding ms acces database and servlet

View Answers

May 26, 2009 at 10:41 AM

Hi Friend,

It seems that you haven't set up DSN connection.

You can use the following steps for creating DSN connection:

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 try the following Servlet code where 'access' is our DSN:

import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class NewServlet extends HttpServlet{
public void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException{
response.setContentType("text/html");
PrintWriter pw = response.getWriter();
Connection connection=null;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
connection = DriverManager.getConnection("jdbc:odbc:access");
Statement st = connection.createStatement();
ResultSet rs = st.executeQuery("Select * from data");
pw.println("Name" + " " + "Address" + "<br>");
while(rs.next()){
pw.println(rs.getString(1) + " " + rs.getString(2) + "<br>");
}
}
catch (Exception e){
pw.println(e);
}
}
}

Thanks









Related Tutorials/Questions & Answers:
regarding ms acces database and servlet - JDBC
regarding ms acces database and servlet  hello there, i am trying to do a web application that makes use of a data base. I opted for ms access database, i could run java main programs(i e not servlets public static void main
I cant get values in MS acces in tables
I cant get values in MS acces in tables   I got problem in sending values from servlet . * i am using ms acces * i cant display my values but der...; Insert form data into MS database Follow these steps: 1)Go to the start->
Advertisements
to get picture from ms access database by jsp-servlet....
to get picture from ms access database by jsp-servlet....  I have inserted a picture in ms access data base,,,how we can retrieve that picture by using jsp
Connect to MS Acces wothout using ODBC but JDBC - JDBC
Connect to MS Acces wothout using ODBC but JDBC  Hi, I want to connect my MS Access using JDBC but not ODBC. Please help me out. Thanks
fetch data from ms acces - Swing AWT
fetch data from ms acces  How do i fetch back AUTO generated key from MS ACCESS table after inserting data through the java panel.... Please Help Thanks in adv.  Hi Friend, Try the following code: import
How to Open Picture From M.S. Access Database using Java Servlet ?
How to Open Picture From M.S. Access Database using Java Servlet ?  Hi all my Friends I have below code which insert a picture into M.S. Access Database But i m still not able to open this picture through Java using M.S. Access
MS Access - JSP-Servlet
MS Access  hello sir, i want to use MS.Access as my database..so my problem is how to connect MS Acces database with servlets ... thank you... stepts 1.to configure the ms access database to your system control panel
jdbc warning regarding to ms access
jdbc warning regarding to ms access  shows warning msg while compiling using ms access : warning: sun.jdbc.odbc.JdbcOdbcDriver is Sun proprietary API... for your database.ADS_TO_REPLACE_3 b) Use the Type for 4 Driver for your database
Updating Ms Access Database using jsp - JSP-Servlet
Updating Ms Access Database using jsp  Hi I am new to jsp and I am trying to update a record in an access database. I only want to update part of the record because the other columns already have data. When I use Update
Regarding Database Creation
Regarding Database Creation  How to use the hibernatetutorial database for running the first application. Is it enough to just create the database on the local host or do we need to create the tables in the database. If i need
regarding web.xml - JSP-Servlet
regarding web.xml  I am the java beginner, please send the web.xml code and how to run a servlet for apache5.0.... my problem is in tomcat manager am..., jsp and servlet tutorials for beginners at http://www.roseindia.net/quickguide
Regarding servlet - Servlet Interview Questions
Regarding servlet  i want to ask question regarding Servlet i have created one servlet in that i have set the one integer value in the context,noe...,by running this servlet i m getting the context value ,now i have made another
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
link hibernate to MS ACCESS database
link hibernate to MS ACCESS database  how to link hibernate to ms access database instead of sql database
regarding JSP - JSP-Servlet
regarding JSP  Hi, This is Malleswari from Satyam. I'm facing a problem while running the JSP tags...like if i want to write or any other, the tag is not supported in my page. In prefix i mentioned "c". still i didnt get
regarding bill generation - JSP-Servlet
regarding bill generation  in this program it is connected with database in mysql.when a customer or user enters he can able to see his payable amount as well as what he paid before as bill
Regarding a project in java - JSP-Servlet
Regarding a project in java  am doing a project on Tiny ETL(Extract Transform and Load), using jsp-servlets. Can u help me out by giving some... friend, Plz specify the technologies you have used like JSP/Servlet/Struts/J2EE
to fetch data from ms word and storing into database
to fetch data from ms word and storing into database  i want to know how to fetch datafields from ms word and storing into database??? please answer soon .its urgent
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
connec to database - JSP-Servlet
connec to database  Need code to connect the application to database. I have developed the application JSP and Servlet
database - JSP-Servlet
database  how to downloaad a file(doc) from database and store in any local system by using servlet
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 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
How to search the table name in MS SQL Database 2005 from application
How to search the table name in MS SQL Database 2005 from application  How to search the table name in MS SQL Database 2005 from application from our helpdesk application? application might be in html
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 it? Please tell what needs to be done after creating a table with an example
regarding-update the Jsp page itself - JSP-Servlet
regarding-update the Jsp page itself   Joined: Aug 17, 2009 Messages: 12 [Post New]posted Today 10:39:52 PM Quote Edit [Up] I have two Jsp pages named bestschool.jsp and schoolnames.jsp. I am calling schoolnames.jsp
applet connected to table in MS Access database
applet connected to table in MS Access database   i have connected my java code with the MS access database and this is my code, can anyone tell me...); }catch(SQLException ex) { System.err.println("database connection
HTML(Registration form) to Jsp to stored into MS ACCESS database
HTML(Registration form) to Jsp to stored into MS ACCESS database  i am sending one html file that contain 18 fields these are stored in ms-access database by using jsp code.i want to urgent jsp code. please urgent sir. thank
Backup MySQL Database - JSP-Servlet
Backup MySQL Database  Database Sir I have been reading Rose's india tutorial "Using MySQL Database with JSP/Servlet". In the Tutorial you have shown an example of backing up the database. When I tried to backup database
server database connection - JSP-Servlet
, which database you want to use Oracle or MS Access? Thanks...server database connection  sir generally we will connect to the database by using the following steps 1.Class.forName("sun.jdbc.odbc.JdbcOdbcDriver
how to acces file in c - WebSevices
how to acces file in c  How to acces file in c.... I have doubt on visual c++ ... how to create dialog control in visual c
upload to database - JSP-Servlet
to upload a pdf file into database(sqlserver2000) using jsp. In roseindia some examples... into database whenever i want that uploaded pdf file i have to retrieve it from database please help me friends thanks in advance it is very urgent
Inserting data on a database in servlet - JSP-Servlet
Inserting data on a database in servlet  Hi I am following the tutorial in this site on servlet and JDBC. I did all the proccedure for connecting to a databse by a servlet.I used the example in "Inserting Data In Database table
i can not connect to database in servlet - JSP-Servlet
offer .   Hi friend, Code to connect to database in servlet...i can not connect to database in servlet  Hi I am following the tutorial in this site on servlet and JDBC. I did all the proccedure for connecting
i can not connect to database in servlet - JSP-Servlet
offer .   Hi friend, Code to connect to database in servlet...i can not connect to database in servlet  Hi I am following the tutorial in this site on servlet and JDBC. I did all the proccedure for connecting
connection with database - JSP-Servlet
with the database by writing the program in java. Following is the code: import... and the connection with the database using jsp code, I get exceptions that I have... with java code. Is there any other way to establish a connection with database in jsp
Load Coursenames from MS Acess Database to JComboBox - Java Beginners
Load Coursenames from MS Acess Database to JComboBox  Hello sir, I want to Load/add Course names which stored in Ms Acess 2007 Database, plz help me  Hi Friend, Try the following code: import java.sql.*; import
cannot insert data into ms access database - Java Server Faces Questions
cannot insert data into ms access database   go back   Hi Friend, You can use the following steps for creating DSN... Microsoft Access Driver(*.mdb) 5. Select database name and Create the DSN name
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, Try the following code: import java.sql.*; import javax.swing.*; import
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
how to delete specified coloumn from database(MS Access) by using windows application
how to delete specified coloumn from database(MS Access) by using windows application  how to delete specified coloumn from database(MS Access) by using c# windows application
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
error in accessing database - JSP-Servlet
database to the servlet i hv succeeded in connectivity but im stuck to nother... database cud ne1 help me out plss  Hi friend, Code to help in solving... to the database"); conn.close(); System.out.println("Disconnected from database
How to retrieve image from database in Servlet?
How to retrieve image from database in Servlet?  Hi, How to retrieve image from database in Servlet? Thanks   Hi, Please check the tutorial Retrieve image from database using Servlet. Thanks
regarding jdbc - JDBC
regarding jdbc  how i can configure java with ms access
unable to validate username and password from ms acess database
unable to validate username and password from ms acess database  this code is not working! please help me to find error. thanks. <%@ page import="java.sql.*" %> <% Connection con=null; String user
unable to validate username and password from ms acess database
unable to validate username and password from ms acess database  this code is not working! please help me to find error. thanks. <%@ page import="java.sql.*" %> <% Connection con=null; String user
unable to validate username and password from ms acess database
unable to validate username and password from ms acess database  //this code is not working! please help me to find error. thanks. <%@ page import="java.sql.*" %> <% Connection con=null; String user
unable to validate username and password from ms acess database
unable to validate username and password from ms acess database  //this code is not working! please help me to find error. thanks. <%@ page import="java.sql.*" %> <% Connection con=null; String user
Upload Image to Database through Servlet - JSP-Servlet
Upload Image to Database through Servlet  Hello, I make.... classpath=C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar...:101249][ServletContext(id=29091418,name=Upload,context-path=/Upload)]: Servlet class

Ads