📄 conntest2.c
字号:
/* close the connection and call commit, it should fail * Author : Jitendra Lenka */#include<AbsSqlStatement.h>#include<SqlFactory.h>int main(){ DbRetVal rv = OK; AbsSqlConnection *con = SqlFactory :: createConnection(CSqlAdapter); rv = con->connect("root","manager"); if(rv!=OK)return 1; printf("Connection opened\n"); rv = con->beginTrans(); if(rv!=OK)return 2; rv = con->disconnect(); if(rv !=OK)return 3;printf("Connection closed\n"); rv = con->commit(); if(rv==OK) { printf("Test script failed\n"); return 4; } printf("After closing the connection, commit failed\n"); printf("Test script pased\n"); delete con; return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -