diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2012-12-23 12:00:04 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2012-12-23 12:00:04 +0100 |
commit | afbfd905b8f5326d149ba7fdfd784af50d85e5ee (patch) | |
tree | 7ebdb883ce69d697af278780bdf67362ce164c2d /src/main/java/io/trygvis/esper/testing/core/db/FileDao.java | |
parent | a057cf0cb5b855d1fedd58d702bd06bb22e938f5 (diff) | |
download | esper-testing-afbfd905b8f5326d149ba7fdfd784af50d85e5ee.tar.gz esper-testing-afbfd905b8f5326d149ba7fdfd784af50d85e5ee.tar.bz2 esper-testing-afbfd905b8f5326d149ba7fdfd784af50d85e5ee.tar.xz esper-testing-afbfd905b8f5326d149ba7fdfd784af50d85e5ee.zip |
o Storing the file file reference on the jenkins build and job.
Diffstat (limited to 'src/main/java/io/trygvis/esper/testing/core/db/FileDao.java')
-rw-r--r-- | src/main/java/io/trygvis/esper/testing/core/db/FileDao.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/io/trygvis/esper/testing/core/db/FileDao.java b/src/main/java/io/trygvis/esper/testing/core/db/FileDao.java index 0878f63..c418970 100644 --- a/src/main/java/io/trygvis/esper/testing/core/db/FileDao.java +++ b/src/main/java/io/trygvis/esper/testing/core/db/FileDao.java @@ -14,7 +14,7 @@ public class FileDao { this.c = c; } - public void store(URI url, String contentType, byte[] data) throws SQLException { + public UUID store(URI url, String contentType, byte[] data) throws SQLException { try (PreparedStatement s = c.prepareStatement("INSERT INTO file(uuid, created_date, url, content_type, data) VALUES(?, ?, ?, ?, ?)")) { UUID uuid = UUID.randomUUID(); int i = 1; @@ -24,6 +24,7 @@ public class FileDao { s.setString(i++, contentType); s.setBinaryStream(i, new ByteArrayInputStream(data), data.length); s.executeUpdate(); + return uuid; } } } |