Can you insert and retrive images in msaccess using java? If yes, how?



Can you insert and retrive images in msaccess using java? If yes, how?..

Answer / Anand Kumar Jha

Yes, it is possible to insert and retrieve images in MS Access using Java. This requires using the JDBC (Java Database Connectivity) API with an ODBC driver for MS Access. Here's a simplified example of retrieving an image:

// Load the driver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

// Establish connection
Connection con = DriverManager.getConnection("jdbc:odbc:DatabaseName");

// Prepare and execute a query to get the image
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT ImageColumn FROM TableName WHERE ID = 1");
Blob blob = rs.getBlob(1);

// Convert the Blob to an InputStream and read the image data

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More MS Access Interview Questions

What is the use of pivot table?

1 Answers  


Does anyone still use microsoft access?

1 Answers  


What is the most important object in an access database?

1 Answers  


What can be the maximum size of an access database?

1 Answers  


The long and short date option in ms access does not show 4 digit years. How would you achieve the mm/dd/yyyy format?

1 Answers  


Can you create a updatecascade, Deletecascade relation in Ms-Access? If yes, give an example?

2 Answers  


How do you create a database in microsoft access?

1 Answers  


What is microsoft access database engine?

1 Answers  


How can I give discount condition in a sales table in MS Access?

1 Answers  


What is the size limitation of an Access database?

1 Answers  


I am designing an Access database form. how can I get my next control in the form to be automatically selected?

1 Answers  


At what levels can data validation be done in microsoft access database?

1 Answers  


Categories