Skip to content

Instantly share code, notes, and snippets.

@cjlucas
Last active August 29, 2015 14:27
Show Gist options
  • Save cjlucas/e85480461fd389cf9751 to your computer and use it in GitHub Desktop.
Save cjlucas/e85480461fd389cf9751 to your computer and use it in GitHub Desktop.
OCCI Boilerplate
#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