jsp-microsoft accessimage

Hi everyone,

I am trying to save an image in a Microsoft Access database, so i can make a query to that image using jsp, and display the image in the .jsp.

The problem is that I don't know what data type to declare in "access" when i am creating the table.

I have tried with OLE Object type, and it doesnt work;

I tried also with Text type, and doesnt work either.

what data type do i have to declare, and how should I save it in the database, so when i make the query from the .jsp the image will be displayed?

thanks...

[565 byte] By [deroka] at [2007-11-27 8:38:06]
# 1

You shouldn't do it that way.

Ok, you've got 'displayimage.jsp', which is in the folder 'JSP Pages'. Put all the images in a folder called 'Images', in the map 'JSP Pages'.

In your database, insert the name of the image, 'image.jpg' for example. In JSP, use the selectquery, use getString to get 'image.jpg' from the database and use the following:

<img src="/images/<%= + filename + %>">

Nidhuggura at 2007-7-12 20:35:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
.
deroka at 2007-7-12 20:35:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Hi,

I did it like this:

<TD>

<img src="images/<%= recordset.getString(5)%>">

</TD>

it worked correctly,

but,

I am having trouble getting all of the images from one column,

this is what i'm trying:

ResultSet result = null;

ResultSetMetaData rsmd = null;

int columns=0;

try {

rsmd = result.getMetaData();

columns = rsmd.getColumnCount();

}

<table width="60%" height="50%" border="1">

<tr>

<%

try {

for (int i=1; i<=1; i++) {

out.write("<th>" + rsmd.getColumnLabel(i) + "</th>");

}

%>

</tr>

<%

while (result.next()) {

out.write("<tr>");

for (int i=1; i<=1; i++) {

out.write("<td>" + result.getString(i) + "</td>");

}

out.write("</tr>");

}

my problem is that I don't know how to insert the:

<img src="images/

what can I do?

deroka at 2007-7-12 20:35:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
WIthin the while-loop:out.println("<td><img width=100 height=100 src=\images\"" + results.getString("image") + "\">");
Nidhuggura at 2007-7-12 20:35:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...