Hello!
1st let me apologize if I have duplicated a post. I am a newbie to DaniWeb (and to Java and HTML) and have searched your forum for a few hours now and not found and answer to my problem. I was hoping someone could help.
I have a simple Java program that reads a MS Access Database and displays selected fields from each record on the screen until the end-of-file. It works wonderful in Eclipse!
I then have a HTML file which implements the java .class file created "TechServices.class".
==============================================================================================================
Here is the code for the Java program:
import java.sql.*;
import java.applet.*;
import java.awt.*;
public class TechServices extends Applet { public static void main(String[] args) {
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String accessFileName = "C:/TEST/Tech ServicesCOPY";
String connURL="jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ="+accessFileName+".accdb;";
Connection con = DriverManager.getConnection(connURL, "","");
Statement stmt = con.createStatement();
stmt.execute("select * from tblProblemInformation");
// execute query in table student
ResultSet rs = stmt.getResultSet();
// get any Result that came from our query
if (rs != null) while ( rs.next() ){
String pdate = rs.getString("dtmProblemDate");
if (pdate != null) pdate = pdate.substring(0,10); // strip off time of 0's
String cdate = rs.getString("dtmClosedDate");
if (cdate != null) cdate = cdate.substring(0,10); // strip off time of 0's
System.out.println("#" + rs.getString("strProblemNumber")
+ " Problem-Date: " + pdate
+ " Close-Date: " + cdate
+ " AssignedTo: "+rs.getString("strAssignedTo"));
// System.out.println("0---------1---------2---------3---------4---------5---------6---------7---------8");
}
stmt.close();
con.close();
}
catch (Exception err) {
System.out.println("ERROR: " + err);
}
}
}
==============================================================================================================
Here is the code for the HTML:
<html>
<head>
</head>
<body bgcolor="pink">
<applet code="TechServices.class" width=1000 height=500>
</applet>
</body>
</html>
==============================================================================================================
Can anyone tell me why this produces nothing but a blank screen when I run the HTML file?
Thanks in advance for your attention to this matter!