conntest2.c
来自「b树实现源码,linux和unix下运行,速度快,极好用」· C语言 代码 · 共 38 行
C
38 行
/* 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 + =
减小字号Ctrl + -
显示快捷键?