comparison src/main/java/nl/cwi/monetdb/util/Extract.java @ 93:eeb71f7d36bf embedded

Fixed a bug on the JDBC MAPI connection from the old code! Fixed the connection properties for an JDBC Embedded connection. To start a JDBC Embedded connection, the user must start the embedded database beforehand with the method MonetDBEmbeddedDatabase.StartDatabase().
author Pedro Ferreira <pedro.ferreira@monetdbsolutions.com>
date Fri, 06 Jan 2017 12:36:33 +0000 (2017-01-06)
parents 6f74e01c57da
children 08bc9009d190
comparison
equal deleted inserted replaced
91:6f74e01c57da 93:eeb71f7d36bf
15 import java.io.InputStream; 15 import java.io.InputStream;
16 import java.io.InputStreamReader; 16 import java.io.InputStreamReader;
17 17
18 18
19 /** 19 /**
20 * This file contains a function to extract files from its including Jar 20 * This file contains a function to extract files from its including Jar package.
21 * package.
22 * 21 *
23 * @author Ying Zhang <Y.Zhang@cwi.nl> 22 * @author Ying Zhang <Y.Zhang@cwi.nl>
24 * @version 0.1 23 * @version 0.1
25 */ 24 */
26 25
27 public class Extract { 26 public class Extract {
28 private static final int DEFAULT_BUFSIZE = 16386; 27 private static final int DEFAULT_BUFSIZE = 16386;
29 28
30 /** 29 /**
31 * Extracts a file from the Jar package which includes this class to 30 * Extracts a file from the Jar package which includes this class to the given destination
32 * the given destination 31 * @param fromFile The file to extract, including it absolute path inside its including Jar package.
33 * @param fromFile The file to extract, including it absolute path
34 * inside its including Jar package.
35 * @param toFile Destination for the extracted file 32 * @param toFile Destination for the extracted file
36 * @throws FileNotFoundException If the file to extract can not be 33 * @throws FileNotFoundException If the file to extract can not be
37 * found in its including Jar package. 34 * found in its including Jar package.
38 * @throws IOException If any error happens during 35 * @throws IOException If any error happens during creating/reading/writing files.
39 * creating/reading/writing files.
40 */ 36 */
41 public static void extractFile(String fromFile, String toFile) throws FileNotFoundException, IOException { 37 public static void extractFile(String fromFile, String toFile) throws FileNotFoundException, IOException {
42 char[] cbuf = new char[DEFAULT_BUFSIZE]; 38 char[] cbuf = new char[DEFAULT_BUFSIZE];
43 int ret; 39 int ret;
44 40