Hello.
Can anybody offer steps for us to resolve this problem?
We have deployed java servlets "search engine" that will connect to an MSAccess
database. We used Jrun2.3 on WinNT and IIS4.0 environment. Simple servlets
[SnoopServlet] would run [that is, we can see output on the internet] but the servlets
can't seem to connect to the MSAccess database. Using the ODBC Administrator via the
userDSN and system DSN tabs, we have entered the name of the *.mdb database and its
location [no username and password].
We get an error: cannot connect. Search results would not display.
This is part of the code:
===========================================
public void dbase(PrintWriter out,String first,String table)
throws IOException
{
Connection con = null;
String city_name = null;
String city_code = null;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:mymdbfile","","");
Statement statement = con.createStatement();
stmt = "Select " + first + " from " + table + " ORDER BY " +
first;
ResultSet rs = null;
rs = statement.executeQuery(stmt);
while (rs.next())
{
=============================================
Another looks like this:
=============================================
//open connection to database
try {
// Load the Driver class file
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// Make a connection to the ODBC datasource Product
//Database
// In this example we are opening a connection to the
// database with every request.
// File to be accessed productdb.mdb
con =
DriverManager.getConnection("jdbc:odbc:Product Database",
"", "");
if ( con != null ) {
====================================================
Hoping to see light from anybody. Thank you.
Daniel Garcia
CTO
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists