Moving "Security" to a separate port, so there can be a Bouncycastle and a Spongycastle implementation. (BC doesn't work on Android, SC can't be used on Oracle's JVM)
This commit is contained in:
@ -28,9 +28,9 @@ import java.sql.SQLException;
|
||||
*/
|
||||
public class JdbcConfig {
|
||||
protected final Flyway flyway;
|
||||
private final String dbUrl;
|
||||
private final String dbUser;
|
||||
private final String dbPassword;
|
||||
protected final String dbUrl;
|
||||
protected final String dbUser;
|
||||
protected final String dbPassword;
|
||||
|
||||
public JdbcConfig(String dbUrl, String dbUser, String dbPassword) {
|
||||
this.dbUrl = dbUrl;
|
||||
|
@ -18,14 +18,15 @@ package ch.dissem.bitmessage.repository;
|
||||
|
||||
import ch.dissem.bitmessage.entity.Streamable;
|
||||
import ch.dissem.bitmessage.entity.payload.ObjectType;
|
||||
import org.flywaydb.core.Flyway;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.sql.*;
|
||||
import java.sql.Blob;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import static ch.dissem.bitmessage.utils.Strings.hex;
|
||||
|
||||
@ -81,8 +82,8 @@ abstract class JdbcHelper {
|
||||
if (data != null) {
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
data.write(os);
|
||||
ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
|
||||
ps.setBlob(parameterIndex, is);
|
||||
byte[] bytes = os.toByteArray();
|
||||
ps.setBinaryStream(parameterIndex, new ByteArrayInputStream(bytes), bytes.length);
|
||||
} else {
|
||||
ps.setBlob(parameterIndex, (Blob) null);
|
||||
}
|
||||
|
Reference in New Issue
Block a user