Tell a friend
Link to us
Bookmark Us
Total Members
      Members: 87129
Sitemap Forum Chat

 
Resource Directory
Beans (0)
Books & Media (0)
Community (0)
Graphics & Charts (1)
JSP Videos (0)
JSP Web Hosting (0)
Other JSP Sites (0)
References (0)
Software & Server (0)
Tag Libraries (0)
Tutorials & Code Snips (0)
Web Applications (1)

 
GROUP INFO
Members: 1
Access Type: Anyone can join

 
GROUPS
.NET
ASP.NET
.NET
C#
ASP
Visual Basic
Java
Java
JSP
EJB
Other
Delphi
C++
Ajax
UML
JavaScript
PHP
Web Design
Web Hosting
SQL Server
Oracle
Project Management
More Groups

 
LEARNING CENTER
TUTORIALS
.NET
.NET Tutorial
ASP Tutorial
ASP.NET Database Tutorial
ASP.NET Development Tips
ASP.Net Security,Internationalisation And Deployment
ASP.NET Server Controls Tips
ASP.NET Tutorial
C Sharp Tutorial
LINQ Tutorial
Web Development
Flex Tutorial
HTML Tutorial
Javascript Tutorial
Learn AJAX Tutorial
PHP Tutorial
Software Development
Database Tutorial
SQL Tutorial
UML Tutorial
Java
Ant Tutorial
EJB 3 Tutorial
Grails Tutorial
Hibernate Tutorial
Java 1.6 Tutorial
Java Tutorial
Java Web Component Tutorial
Java XML Tutorial
JDBC Tutorial
JDK1.5 Tutorial
JSF Tutorial
JSP And J2EE Design Tutorial
JSP Tutorial
Service-Oriented Architecture (SOA) Tutorial For Managers
Spring Tutorial
Struts Tutorial
Tomcat Tutorial

RESOURCES
Q & A (531 )
Source Code (3276 )
Articles (366 )
Books (373 )
Components (1647 )
News (898 )
Websites (1208 )

SUBMISSIONS
Submit Article
Submit Website
Submit News
Submit Source Code
Submit Component

COMMUNITY
Authors
Members Directory
Discussion Forum
Chat

SITE
About Us
Sitemap
Search
Contact Us
Feedback
Tell a Friend
Advertise

 

Home > JSP > Member Articles > Databases >
 

Connecting JSP With MS Access


  Author : sampad
  Date Published : 04/9/2006
  Rating No Rating
  Accessed : 2024
   sampad
<%@page import ="java.io.*"%>
<%@page import ="javax.servlet.*"%>
<%@page import ="javax.servlet.http.*"%>
<%@page import ="java.sql.*"%>

<%!
Connection conn=null;
Statement st;
ResultSet rs;
String login,password;
String pass,logg;
String sql;

String database = "e:\trashmagic\login.mdb";

String url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" + database + ";DriverID=22;READONLY=false";
public void jspInit()
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn = DriverManager.getConnection(url);
}

catch(Exception ex)
{
ex.printStackTrace();
}


}
%>


 
   Add Comment  Printer Friendly
   View All Comments  Email to a friend
   Add to my Favourites  Report Bad Submissions  Submit Feedback
   Rating Download PDF version
 
                 Click each image to add
this page to each site.
 
Related Articles of JSP
Previous Article    -     Random Articles    -     Next Article
 
 
 
Comments Available
Connecting JSP with MS Access  By : MaTreX_2009
31st Aug 2006 02:28 AM

This code Describe how to ConnectJSP with MS Access.
//***************************
public class DBConnection {
private Connection connection;
private Statement statement;

public DBConnection() throws Exception
{
String dataSourceName = "FACULTYDB";
String dbURL = "jdbc:odbc:" + dataSourceName;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
connection= DriverManager.getConnection(dbURL,"","");

statement = connection.createStatement();
}
//***************************

This code Describe how to ConnectJSP with MySql DataBase
//***************************
public class DBConnection {
private Connection connection;
private Statement statement;

public DBConnection() throws Exception{
//String dataSourceName = "DBName";
String dbURL = "jdbc:mysql://localhost:3306/DBName";
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
connection= DriverManager.getConnection(dbURL,"Username","Password");
statement = connection.createStatement();
}
//***************************
 
 
 
 
 
Welcome Guest Signup
Member's Panel
EMAIL
PASSWORD
Forgot your password?
New User? Click Here!
 
Resend Activation Email!

SEARCH
 



 
 
 
 
 


Home | Login | About Us | Contact Us | Privacy Policy | Advertising | Feedback Please