How to read and extract zip entries from java.sql.Blob type zip file without having FileInputStream or filepath as a string java
问题 public static void unzipFiles(java.sql.Blob zip) throws Exception{ String paths = ""; byte[] blobAsBytes = zip.getBytes(1, (int) zip.length()); ZipInputStream zis = new ZipInputStream(zip.getBinaryStream(), StandardCharsets.UTF_8); ZipEntry zipEntry = null; while ((zipEntry = zis.getNextEntry()) != null) { paths=zipEntry.getName()+" "; } Connection conn = DriverManager.getConnection("jdbc:default:connection:"); String sql = "INSERT INTO E (FILENAME) VALUES (:paths)"; PreparedStatement pstmt =