I have the following structure. I am joining some tables together to get a result from my SQL database. I have a column that actually stores an BLOB image in it. I would like to know how can I retrieve this information in a variable that can then be used to load this image in a Graphical User Interface such as swing window.
Here is my code on how I am reading other - String - fields of the database.
ResultSet result = statement.executeQuery(SQLQuery);
ResultSetMetaData metaData = rs.getMetaData();
while (result.next())
{
for (int i = 1; i <= columnsNumber; i++)
{
String AttributeName = metaData.getColumnName(i);
String AttributeValue = result.getString(i);
if(AttributeName == "UserName")
{
String userName = AttributeValue;
}
if(AttributeName == "UserImage")
{
//code here to get the BLOB user Image.?
}
}
}
And lastly an idea of how can, with a given picture (from the filesystem) to store this image as BOLB in the database?
Cheers.
I read about this one but I think this implementation can't help me.