Last active
August 29, 2015 14:27
-
-
Save cjlucas/e85480461fd389cf9751 to your computer and use it in GitHub Desktop.
OCCI Boilerplate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <occi.h> | |
#include <stdio.h> | |
using namespace oracle::occi; | |
int main(int argc, char *argv[]) | |
{ | |
auto env = Environment::createEnvironment(); | |
auto conn = env->createConnection("username", "password", "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=XE)))"); | |
auto stmt = conn->createStatement("INSERT INTO BLAH (DATA) VALUES (:1)"); | |
stmt->execute(); | |
conn->commit(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment