public static AbstractJDBCUtil getInstance(DBType dbType) { if(dbType == DBType.MySQL) return new MySQLUtil(); else if(dbType == DBType.Oracle) return new OracleUtil(); else if(dbType == DBType.SQLServer) return new SQLServerUtil(); else if(dbType == DBType.PostGIS) return new PostGISUtil(); else if(dbType == DBType.Sybase) return new SybaseUtil(); else return null; }
public static Object createJson(Reader reader) { // This is an ugly, and surely inefficient solution, but I can't figure // out a way around it. String x = readerToString(reader); return createJson(x); }
public ArrayList<ArrayList<String>> getDataForTable(DBType dbType, String hostname, int portnumber, String username, String password, String tableName, String dBorSIDName) throws SQLException, ClassNotFoundException { Connection conn = getConnection(hostname, portnumber, username, password, dBorSIDName); return getDataForTable(conn, tableName); }
public ImportFileCommand(String id, String model, File file) { super(id, model); this.file = file; this.encoding = EncodingDetector.detect(file); }
public Worksheet generateWorksheetForAllRows() throws SQLException, ClassNotFoundException { /** * Get the data from the database table * */ AbstractJDBCUtil dbUtil = JDBCUtilFactory.getInstance(dbType); ArrayList<ArrayList<String>> data = dbUtil.getDataForQuery(dbType, hostname, portnumber, username, password, query, dBorSIDName); return generateWorksheet(dbUtil, data); }
public Worksheet generateWorksheetForAllRows() throws SQLException, ClassNotFoundException { /** * Get the data from the database table * */ AbstractJDBCUtil dbUtil = JDBCUtilFactory.getInstance(dbType); ArrayList<ArrayList<String>> data = dbUtil.getDataForTable(dbType, hostname, portnumber, username, password, tableName, dBorSIDName); return generateWorksheet(dbUtil, data); }
@Override public JSONObject call(JSONObject left, JSONObject right) throws Exception { return JSONLDUtilSimple.mergeJSONObjects(left, right, provenaceProperties); } }, numPartitions);
public JsonImport(String jsonString, String worksheetName, Workspace workspace, String encoding, int maxNumLines) { this(JSONUtil.createJson(jsonString), worksheetName, workspace, encoding, maxNumLines); }
public ArrayList<String> getListOfTables(DBType dbType, String hostname, int portnumber, String username, String password, String dBorSIDName) throws SQLException, ClassNotFoundException { Connection conn = getConnection(hostname, portnumber, username, password, dBorSIDName); return getListOfTables(conn); }
public ArrayList<ArrayList<String>> getDataForQuery(DBType dbType, String hostname, int portnumber, String username, String password, String tableName, String dBorSIDName) throws SQLException, ClassNotFoundException { Connection conn = getConnection(hostname, portnumber, username, password, dBorSIDName); return getDataForQuery(conn, tableName); }
public ImportDatabaseTableCommand(String id, String model, String revisedId, String dbType, String hostname, int portNumber, String userName, String password, String dBorSIDName) { super(id, model, revisedId); this.dbType = DBType.valueOf(dbType); this.hostname = hostname; this.portnumber = portNumber; this.username = userName; this.password = password; this.dBorSIDName = dBorSIDName; }
public static String getStringValue(String arg, JSONArray json) throws JSONException { JSONObject obj = getJSONObjectWithName(arg, json); if (obj == null) return null; else return obj.getString(JsonKeys.value.name()); }
public static JSONObject mergeJSONObjects(JSONObject left, JSONObject right, Map<String, String> provenanceProperties) { mergeJSONObjectsInner(left, right, provenanceProperties); return left; }
public Preferences(String preferencesId, String contextId) { this.preferencesId = preferencesId; this.contextId = contextId; populatePreferences(); }
public ImportFileCommand(String id, String model, String revisionId, File file) { super(id, model, revisionId); this.file = file; this.encoding = EncodingDetector.detect(file); }
public ImportSQLCommand(String id, String model, String dbType, String hostname, int portNumber, String userName, String password, String dBorSIDName, String query) { super(id, model); this.dbType = DBType.valueOf(dbType); this.hostname = hostname; this.portnumber = portNumber; this.username = userName; this.password = password; this.dBorSIDName = dBorSIDName; this.query = query; }
public static JSONArray getJSONArrayValue(String name, JSONArray json) throws JSONException { JSONObject obj = getJSONObjectWithName(name, json); if (obj == null) return null; else return obj.getJSONArray(JsonKeys.value.name()); }
public ImportJSONLinesFileCommand(String id, String model, String revisedId, File file) { super(id, model, revisedId, file); this.encoding = EncodingDetector.detect(file); }
public ImportSQLCommand(String id, String model, String revisedId, String dbType, String hostname, int portNumber, String userName, String password, String dBorSIDName, String query) { super(id, model, revisedId); this.dbType = DBType.valueOf(dbType); this.hostname = hostname; this.portnumber = portNumber; this.username = userName; this.password = password; this.dBorSIDName = dBorSIDName; this.query = query; }
public ImportDatabaseTableCommand(String id, String model, String dbType, String hostname, int portNumber, String userName, String password, String dBorSIDName) { super(id, model); this.dbType = DBType.valueOf(dbType); this.hostname = hostname; this.portnumber = portNumber; this.username = userName; this.password = password; this.dBorSIDName = dBorSIDName; }