The easiest way to store blobs in a database?

When writing a script utility to insert images into a database, I wondered if there was a way to do this. In the end, decided something like this:

def sql = Sql.newInstance(...) // ... Connection conn = sql.getConnection() PreparedStatement stmt.prepareStatment(...) stmt.setBinary(...) stmt.executeUpate() 

There must be a more attractive way, can someone enlighten me?

0
source share
1 answer

Groovier can just save the path if you saved the images.

Saving images in a directory and saving only the path in db is the best way.

+2
source

All Articles