nd4j-jdbc/nd4j-jdbc-api/src/main/java/org/nd4j/jdbc/loader/impl/BaseLoader.java
@Override
    public Blob convert(IComplexNDArray toConvert) throws IOException, SQLException {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(bos);

        Nd4j.writeComplex(toConvert, dos);

        byte[] bytes = bos.toByteArray();
        Connection c = dataSource.getConnection();
        Blob b = c.createBlob();
        b.setBytes(1, bytes);
        return b;
    }
@Override
    public Blob convert(IComplexNDArray toConvert) throws IOException, SQLException {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(bos);

        Nd4j.writeComplex(toConvert, dos);

        byte[] bytes = bos.toByteArray();
        Connection c = dataSource.getConnection();
        Blob b = c.createBlob();
        b.setBytes(1, bytes);
        return b;
    }
@ Override public Blob convert ( IComplexNDArray toConvert ) throws IOException , SQLException { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; DataOutputStream dos = new DataOutputStream ( bos ) ; Nd4j . writeComplex ( toConvert , dos ) ; byte [ ] bytes = bos . toByteArray ( ) ; Connection c = dataSource . getConnection ( ) ; Blob b = c . createBlob ( ) ; b . setBytes ( 1 , bytes ) ; return b ; }
Convert an ndarray to a blob

@param toConvert the complex ndarray to convert
@return the converted complex ndarray
Convert an ndarray to a blob