Changeset 34903
- Timestamp:
- 2021-02-19T17:38:54+13:00 (3 years ago)
- Location:
- gs2-extensions/tipple-bridge/trunk/src
- Files:
-
- 2 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/tipple-bridge/trunk/src/src/main/java/sqlCli.java
r34901 r34903 47 47 String dbName; 48 48 49 //project id - it should be required right? 50 //if they omit, the query would come up empty. 51 @Option(names = {"--projectID"}, description = "ID number of the project") 52 String projectID; 53 49 54 @Option(names = {"--host"}, description = "Type of host e.g. localhost ", 50 55 required = true, defaultValue = "localhost") … … 70 75 //else we're good to go. 71 76 // databaseConnect(userName, password, port, dbName, projectID, jsonOutputFile, host); 72 int status = databaseConnect(userName, password, port, dbName, jsonOutputFile, host);77 int status = databaseConnect(userName, password, port, dbName, projectID, jsonOutputFile, host); 73 78 return status; 74 79 } … … 81 86 82 87 private static int databaseConnect(String user, String pass, int port, String dbName, 83 String fileName, String host){88 String projectID, String fileName, String host){ 84 89 Connection conn; 85 90 Statement stmt; … … 117 122 */ 118 123 119 // String sql = "SELECT name, id, typeId, created from td_ContentItem where projectId="+projectID; 120 121 String sql = "SELECT cItem.name, cItem.created, mFile.path\n" + 122 "FROM td_ManagedFile AS mFile, td_ContentItem AS cItem, td_ContentItem_MediaItem AS cMediaItem, td_MediaItem AS mItem\n" + 123 "WHERE\n" + 124 "cItem.id = cMediaItem.contentItemId \n" + 125 "and cMediaItem.mediaItemId = mItem.id\n" + 126 "And mItem.fileId = mFile.id\n" + 127 "ORDER BY mFile.projectId;\n"; 124 String sql = "SELECT name, id, typeId, created from td_ContentItem where projectId="+projectID; 125 /* 126 String sql = "select td_Document.id, td_Document.content " + 127 "from td_Document, td_ContentItem, td_ContentItem_Document " + 128 "where td_ContentItem.projectId=" + projectID + " and td_ContentItem.id = 129 td_ContentItem_Document.ContentItemId " + 130 "and td_ContentItem_Document.documentId = td_Document.id;"; 131 */ 128 132 ResultSet myResult = stmt.executeQuery(sql); 129 133 ResultSetMetaData resultMetaData = myResult.getMetaData();
Note:
See TracChangeset
for help on using the changeset viewer.