()
| 120 | } // end of MongoConnect |
| 121 | |
| 122 | public int MongoDisconnect() { |
| 123 | int rc = 0; |
| 124 | |
| 125 | try { |
| 126 | if (cursor != null) { |
| 127 | if (DEBUG) |
| 128 | System.out.println("Closing cursor"); |
| 129 | |
| 130 | cursor.close(); |
| 131 | cursor = null; |
| 132 | } // endif client |
| 133 | |
| 134 | if (client != null) { |
| 135 | if (DEBUG) |
| 136 | System.out.println("Closing connection"); |
| 137 | |
| 138 | client.close(); |
| 139 | client = null; |
| 140 | } // endif client |
| 141 | |
| 142 | } catch (MongoException se) { |
| 143 | SetErrmsg(se); |
| 144 | rc += 8; |
| 145 | } // end try/catch |
| 146 | |
| 147 | return rc; |
| 148 | } // end of MongoDisconnect |
| 149 | |
| 150 | public boolean GetCollection(String name) { |
| 151 | if (DEBUG) |