Changeset 34901 for gs2-extensions
- Timestamp:
- 2021-02-19T16:06:54+13:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/tipple-bridge/trunk/src/src/main/java/sqlCli.java
r34900 r34901 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 54 49 @Option(names = {"--host"}, description = "Type of host e.g. localhost ", 55 50 required = true, defaultValue = "localhost") … … 75 70 //else we're good to go. 76 71 // databaseConnect(userName, password, port, dbName, projectID, jsonOutputFile, host); 77 int status = databaseConnect(userName, password, port, dbName, projectID,jsonOutputFile, host);72 int status = databaseConnect(userName, password, port, dbName, jsonOutputFile, host); 78 73 return status; 79 74 } … … 86 81 87 82 private static int databaseConnect(String user, String pass, int port, String dbName, 88 String projectID,String fileName, String host){83 String fileName, String host){ 89 84 Connection conn; 90 85 Statement stmt; … … 122 117 */ 123 118 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 */ 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"; 132 128 ResultSet myResult = stmt.executeQuery(sql); 133 129 ResultSetMetaData resultMetaData = myResult.getMetaData();
Note:
See TracChangeset
for help on using the changeset viewer.