Message-ID: <1024119810.897.1425423232487.JavaMail.firstname.lastname@example.org> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_896_424012308.1425423232486" ------=_Part_896_424012308.1425423232486 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Here you are:
The output should be:
Why the INSERT in this code fails?
Because the insertSQL is a GString. if you make it a Stri= ng like this
it will work. Or you can do it like this:
In the last code snippet, GSQL will automatically create a prepared stat= ement for you and run it.
I modified the code to get it to work with Oracle and for readability. The Sql.newInstance will connect to an Oracle database SID called XE i=
nstalled on localhost
at port 1521. The database user is "userna= me" and the password is "password".
In order to get th= is to work you will have to install the the latest jdbc.jar file from Oracl= e's website. You need to install the .jar file into the
lib dir= ectory in your GROOVY_HOME directory:
The code does the following:
1. Creates TableA in username's schema
2. Inserts a row into Table= A
3. Performs a SELECT * FROM TableA;
4. Returns "TableA r= ow: Bill Lyons"