Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在编写实用程序脚本以将图像插入数据库时,我想知道是否有一种更规范的方法。最后解决了一些类似的问题:
def sql = Sql.newInstance(...) // ... Connection conn = sql.getConnection() PreparedStatement stmt.prepareStatment(...) stmt.setBinary(...) stmt.executeUpate()
必须有一种更时髦的方法,有人可以启发我吗?
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.