comparison src/db.cpp @ 11:dfcf8c973219

Implement Cache maker.
author pyon@macmini
date Wed, 07 May 2014 20:38:57 +0900
parents b455f2d8aac9
children bbd65edf71d4
comparison
equal deleted inserted replaced
10:29021e6e1ebe 11:dfcf8c973219
1 // Filename : db.cpp 1 // Filename : db.cpp
2 // Last Change: 16-Apr-2014. 2 // Last Change: 02-May-2014.
3 // 3 //
4 4
5 #include "db.h" 5 #include "db.h"
6 #include "wx/wxsqlite3.h" 6 #include "wx/wxsqlite3.h"
7 7
225 } 225 }
226 stmt.Finalize(); 226 stmt.Finalize();
227 ccndb.Close(); 227 ccndb.Close();
228 228
229 return data; 229 return data;
230 }
231
232 /* 範囲日時のパスを取得 */
233 wxArrayString GetPathes( wxString from, wxString to )
234 {
235 wxArrayString path;
236
237 wxString gszFile = wxGetCwd() + wxFILE_SEP_PATH + wxT("db") + wxFILE_SEP_PATH + wxT("ccn.db");
238 wxSQLite3Database ccndb;
239 ccndb.Open( gszFile );
240
241 wxSQLite3Statement stmt = ccndb.PrepareStatement( "SELECT path FROM path WHERE date >= ? AND date <= ?" );
242 stmt.Bind( 1, from );
243 stmt.Bind( 2, to );
244 wxSQLite3ResultSet q = stmt.ExecuteQuery();
245
246 if ( !q.IsNull(0) ) {
247 while ( q.NextRow() ) {
248 path.Add( q.GetString(0) );
249 }
250 }
251 stmt.Finalize();
252 ccndb.Close();
253
254 return path;
230 } 255 }
231 256
232 /* 合議体から被保険者番号を取得 */ 257 /* 合議体から被保険者番号を取得 */
233 wxArrayString GetHhsNoByCcn( wxString ccn, wxString date ) 258 wxArrayString GetHhsNoByCcn( wxString ccn, wxString date )
234 { 259 {