aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/trygvis/esper/testing/core/db
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-12-23 12:00:04 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2012-12-23 12:00:04 +0100
commitafbfd905b8f5326d149ba7fdfd784af50d85e5ee (patch)
tree7ebdb883ce69d697af278780bdf67362ce164c2d /src/main/java/io/trygvis/esper/testing/core/db
parenta057cf0cb5b855d1fedd58d702bd06bb22e938f5 (diff)
downloadesper-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')
-rw-r--r--src/main/java/io/trygvis/esper/testing/core/db/FileDao.java3
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;
}
}
}