Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JDBC regarding ms acces database and servlet
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


aravind
regarding ms acces database and servlet
1 Answer(s)      5 years and 4 months ago
Posted in : JDBC



Advertisement
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
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
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
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... visit JDBC-ODBC Bridge and download the driver for your database. b) Use
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
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
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
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 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
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
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
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
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
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
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 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
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
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
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
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 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
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
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
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
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
 

 

 

DMCA.com