0

在编写实用程序脚本以将图像插入数据库时​​,我想知道是否有一种更规范的方法。最后解决了一些类似的问题:

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

必须有一种更时髦的方法,有人可以启发我吗?

4

1 回答 1

2

A "Groovier" way could be just storing the path were you'd store the images.

Storing the images in a directory and storing just the path in the db is the best way.

于 2008-11-27T18:27:19.333 回答