Message-ID: <439776389.96377.1397993138141.JavaMail.email@example.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_96376_1936045219.1397993138140" ------=_Part_96376_1936045219.1397993138140 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"