1 /***************************************************************************
2 * Copyright (C) 2007 by www.databasecache.com *
3 * Contact: praba_tuty@databasecache.com *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 ***************************************************************************/
18 //#include<DatabaseManagerImpl.h>
19 //#include <Statement.h>
20 #include <SqlFactory.h>
21 #include <SqlConnection.h>
22 //#include <SqlNwConnection.h>
23 //#include <SqlNwStatement.h>
24 //#include <readline/readline.h>
25 //#include <readline/history.h>
26 //#define SQL_STMT_LEN 1024
30 AbsSqlConnection
*conn
= NULL
;
31 AbsSqlStatement
*stmt
= NULL
;
33 int main(int argc
, char **argv
)
35 char username
[IDENTIFIER_LENGTH
];
37 char password
[IDENTIFIER_LENGTH
];
43 /* while ((c = getopt(argc, argv, "u:p:")) != EOF)
47 case 'u' : strcpy(username , argv[optind - 1]); break;
48 case 'p' : strcpy(password , argv[optind - 1]); break;
49 default: printf("Wrong args\n"); exit(1);
55 conn
= SqlFactory::createConnection(CSqlDirect
);
56 DbRetVal rv
= conn
->connect(I_USER
, I_PASS
);
61 SqlConnection
*sqlcon
= (SqlConnection
*) conn
;
62 rv
= sqlcon
->getExclusiveLock();
68 DatabaseManager
*dbMgr
= conn
->getConnObject().getDatabaseManager();
69 rv
= dbMgr
->checkPoint();
71 printError(rv
, "checkpoint: failed");