SQL: Bind variables in INSERT statement resulting in extra SELECT statement

2020-07-31 Thread Mike M
A statement such as: String qry = "INSERT INTO Author (firstname, lastname) VALUES ('$name', '$name')" sql.execute qry results in one database roundtrip, as one would expect. Using bind variables such as this: sql.execute "INSERT INTO Author (firstname, lastname) VALUES ($fname, $lname)" result

Re: Omitting parentheses on .size() ?

2020-07-31 Thread Paul King
What Daniel said is correct. Also if there was an accessible getSize() method, you could use just ".size". Cheers, Paul. On Sat, Aug 1, 2020 at 11:19 AM Daniel Sun wrote: > > The parentheses of methods without parameters could not be ommitted. > > `[1, 2, 3].size` is accessing the private field

Re: Omitting parentheses on .size() ?

2020-07-31 Thread Daniel Sun
The parentheses of methods without parameters could not be ommitted. `[1, 2, 3].size` is accessing the private field `size` of `ArrayList`, so illegal reflective access warning will be thrown. Cheers, Daniel Sun On 2020/08/01 00:49:54, paul wrote: > Hi all, > > (on latest groovy 3.0.5 and O

Omitting parentheses on .size() ?

2020-07-31 Thread paul
Hi all, (on latest groovy 3.0.5 and OpenJDK 14) omitting the empty parentheses to the .size() call works, but throws an illegal reflective access warning: ``` groovy:000> [1,2,3].size WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.codehau