473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

JSP and Databases

53
How to connect a JSP page with a database?

I have tried connecting a MS Access database with a JSP Page.Im using Apache Tomcat as my Web server.

It is showing a Sql Execption as,
No default driver specified.
Plz tell me how can i avoid the error...
Sep 20 '07 #1
2 1198
r035198x
13,262 8TB
How to connect a JSP page with a database?

I have tried connecting a MS Access database with a JSP Page.Im using Apache Tomcat as my Web server.

It is showing a Sql Execption as,
No default driver specified.
Plz tell me how can i avoid the error...
Post the code you used to connect the database.
Sep 20 '07 #2
vinot85
53
Here is the Code i have used to create the thing.

Expand|Select|Wrap|Line Numbers
  1.  <%@page import="java.sql.*"%>
  2. <%
  3.  
  4.       String a1,a2;
  5.     Connection con;
  6.     Statement p;
  7.     ResultSet rs;
  8.       a1= request.getParameter("t1");
  9.       a2 =  request.getParameter("t2");
  10.       try{ 
  11.             Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  12.     }
  13.     catch(ClassNotFoundException cnf){
  14.         cnf.printStackTrace();
  15.     }
  16.     try{
  17.         out.println("im here");
  18.             con=DriverManager.getConnection("jdbc:odbc:praise1","exam01", "exam01");
  19.             p=con.createStatement();
  20.         rs = p.executeQuery("select * from emptable");
  21.         while(rs.next()){
  22.             out.println(" "+rs.getInt("no"));
  23.             out.println(rs.getString("name"));
  24.         }
  25.        }
  26.      catch(SQLException rr){
  27.             out.println(rr);
  28.        }
  29. %>
Sep 24 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Gary L. Burnore | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.mysql This is an invitation to discuss the following proposal to create newsgroup comp.databases.mysql. Please note that YOU CANNOT...
8
by: William Drew | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.mysql This is an invitation to discuss the following proposal to create newsgroup comp.databases.mysql. Please note that YOU...
0
by: Cara | last post by:
LAST CALL FOR VOTES (of 2) unmoderated group comp.databases.etl Newsgroups line: comp.databases.etl Extraction, transformation, loading issues. Votes must be received by 23:59:59 UTC, 12 Dec...
1
by: Hai-Chu Hsu | last post by:
Hi, I want to restore my databases from the old SQL Server installation into a new installation of SQL Server. My new installation of SQL Server has different data path from the old...
0
by: Cara Altman | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.etl This is a formal Request For Discussion (RFD) for the creation of a world-wide unmoderated Usenet newsgroup...
3
by: Amit | last post by:
Hi when I try to run LIST ACTIVE DATABASES AT DBPARTITIONNUM <partnum> or LIST ACTIVE DATABASES GLOBAL, I always get an error message. Does anyone know why? I'm on v8 fp 5 output : db2 => list...
1
by: com | last post by:
Extreme Web Reports 2005 - Soft30.com The wizard scans the specified MS Access database and records information such as report names, parameters and subqueries. ......
6
by: Andy | last post by:
Someone posted this official proposal to create comp.databases.postgresql.general again. He wrote his own charter. As far as I know, he did not consult any of the postgresql groups first. There...
6
by: Tjerk Wolterink | last post by:
Don't know wether this is the right newsgroup, anyways: Has anyone some experience with Native XML Databases. Im planning to use this: http://exist.sourceforge.net/ It has many advantages...
3
by: AK | last post by:
Hi Our product uses MS-SQL Server 2000. One of our customer has 10 installations with each installation stroring data in its own database. Now the customer wants to consolidate these databases...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.