need help to get memo data
843836Jun 2 2004 — edited Jun 2 2004Hi all,
I am beginner in Java and implementing online database using MSAccess. I am trying to get data from access database to put in the scroll bar. When I try without memo filed it is working in the result screen. But when i want to get memo field from database as below it is not working. Also I can not get image too. Please help me out for that. Thanks, I use Blob variable for memo field..
<%
String name;
String date;
// byte[] photo;
int id;
int j=0;
Blob message;
try {
ResultSet rs = null;
// get from database
// loading the driver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// Making the connection
Connection conn = DriverManager.getConnection("jdbc:odbc:StaffNews","","");
Statement stmt = conn.createStatement();
rs = stmt.executeQuery("SELECT * from Main");
while(rs.next()){
out.print ("singletext["+j+"]='<font color=\"#FFFFFF\"><Hr><b>Traffic Management Center</b></font><hr><br><br>");
id = rs.getInt("ID");
date = rs.getString("Date");
name = rs.getString("Name");
message = rs.getBlob("Message");
// String photoName = rs.getString("PhotoName");
// photo = rs.getByte("Photo");
out.print(""+"<font color=\"#FFFFFF\">"+id+"<br>");
out.print("<font color=\"#FFFFFF\">"+date+"</font><br>");
out.print("<font color=\"red\">"+name+"</font><br>");
out.print("<font color=\"#FFFFFF\">"+message+"</font><br>");
// out.print("<IMG SRC="+'"'+photo+'"'+"><br>");
out.print("<HR>");
j = j + 1;
out.println ("<br><br><Br>'");
}
}
catch(Exception e){
out.println(e.getMessage());
}
%>