|
This is what u need!
public void init(ServletConfig conf) throws ServletException{
super.init(conf);
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:webdemo");
dispStmt = con.createStatement();
} catch (Exception e)
{
throw(new UnavailableException(this, "Sorry! The Database didn't load!"));
}
}
webdemo is the database name (it could be any name) that you add to
the System DSN.
Tere Millán López wrote:
Hi all! I
have a servlet and I would like to do a connection to a MSAccess Database.
Does anyone have the code tor doing it?
Or does anybody know how i can do it?
I'm working with JSDK2.1and Windows 98 and my server
is http://localhost:8080Unknown
Thanks very much TML------------------------------------Tere
MILLAN LOPEZ
ENSSIB69100 Villeurbanne
France. ___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED]
and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
--
Amy Wan
local: 3208
2WB08
|