Return-Path: X-Original-To: apmail-groovy-users-archive@minotaur.apache.org Delivered-To: apmail-groovy-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0DF451857F for ; Sun, 10 Jan 2016 06:28:43 +0000 (UTC) Received: (qmail 64398 invoked by uid 500); 10 Jan 2016 06:28:42 -0000 Delivered-To: apmail-groovy-users-archive@groovy.apache.org Received: (qmail 64362 invoked by uid 500); 10 Jan 2016 06:28:42 -0000 Mailing-List: contact users-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.apache.org Delivered-To: mailing list users@groovy.apache.org Received: (qmail 64352 invoked by uid 99); 10 Jan 2016 06:28:42 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Jan 2016 06:28:42 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 58370C17D3 for ; Sun, 10 Jan 2016 06:28:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.325 X-Spam-Level: ** X-Spam-Status: No, score=2.325 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.554, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 9BTRJN9U-sym for ; Sun, 10 Jan 2016 06:28:37 +0000 (UTC) Received: from nm38-vm4.bullet.mail.ne1.yahoo.com (nm38-vm4.bullet.mail.ne1.yahoo.com [98.138.229.148]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 95B6543B1D for ; Sun, 10 Jan 2016 06:28:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1452407311; bh=31rE6XGrmZ/5AVtq0KREyToYenwoqkFhzSsRYFeUf8E=; h=Date:From:Reply-To:To:Subject:References:From:Subject; b=Zmv1fACx5dFfP07CvN2cBLaJ3kH3MfV8Wtna0IarQuwgKffkRw0cNUjtmqXpm8UxINdr8Vr9/KfBerYikJtWL0aJGEgt2jH2Vm+2IvW4aBoBwmsixkQq8m8FZa1rcPEp0gXKcPG9+qnO/6LOgQ67hOpcDhj1ttNqYcD24JiGaJHfYFH4T91IEBJ+CRNdg/jBokdsQg4alv65Lg3HkvyLh94jJBBdP8zf8SSTqz7zbBNPUVVP2it910FrLP0Cx/VCbMvthCAv704VyBG/OLyZyH5HspR6YdbOYfUCRqpzGfa65E8/lDG2Scw9XkaSDpVT/kl9RVkzpK4ulqL3e5HZ9Q== Received: from [127.0.0.1] by nm38.bullet.mail.ne1.yahoo.com with NNFMP; 10 Jan 2016 06:28:31 -0000 Received: from [98.138.100.115] by nm38.bullet.mail.ne1.yahoo.com with NNFMP; 10 Jan 2016 06:25:42 -0000 Received: from [98.138.89.193] by tm106.bullet.mail.ne1.yahoo.com with NNFMP; 10 Jan 2016 06:25:42 -0000 Received: from [127.0.0.1] by omp1051.mail.ne1.yahoo.com with NNFMP; 10 Jan 2016 06:25:42 -0000 X-Yahoo-Newman-Property: ymail-4 X-Yahoo-Newman-Id: 645232.83226.bm@omp1051.mail.ne1.yahoo.com X-YMail-OSG: iz2n0qMVM1nVmG2zXHdUFZ0GUv3ykRkpbKqqTbk0hcK1Z9MRB.0Wro6i.Mp1a7t iuRiAZpa5xwyCtttBhNJsxZe7v83xBH2qwYT.ibxd2ngTxP5I5rdUshwTfTpSvTRjnC12_Zk0EI6 G1HFKKV0AlIVt_0YDGQjv.6Bn_2cWuHAHLrzHfY4cPk4GcPcAHewontR7BSgP0Sq1KixAhpKsl_Q eQ5vNgbjpte5Xl71qR3dVntI8RpeewCKzWN0Nv8sC.9TucLdA7EMDU8rtq_dPbtFmb_ca6v_eD_d erkEZ.7E.0cPr_0WXYh4xS_DN0hPKy_oQxDTgNm5qaa7xvLhRqsYsoq_aY9S76f4KAnN_tGN0PON cCYoEoroR_oj3c85_6O9oFaLg_jjnSAyw.yLEj7_Kpzl98ru1oxS7SanjmGmARt8QPJAFs2sFUct ahRN6DTdu4dlMrItY.IRAQeBhD13eVPm268vof13SDWGuom2O0fjjShN2tW_E1nSJmWbUskAY9yF 7ZG2rJL1h.QUBitNyiBrA4WrVKu7TW77ooVcfn5UFOJlsbADhFG2j Received: by 98.138.105.194; Sun, 10 Jan 2016 06:25:42 +0000 Date: Sun, 10 Jan 2016 06:25:41 +0000 (UTC) From: Richard Heintze Reply-To: Richard Heintze To: "users@groovy.apache.org" Message-ID: <1696513649.2213372.1452407141758.JavaMail.yahoo@mail.yahoo.com> Subject: Wanted: help with using jdbc grapes in groovy shell? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2213371_825129240.1452407141755" References: <1696513649.2213372.1452407141758.JavaMail.yahoo.ref@mail.yahoo.com> ------=_Part_2213371_825129240.1452407141755 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Why does the groovy shell require a special syntax? I'm trying to make this work in the groovyConsole. @GrabConfig(systemClassLoader=3Dtrue) groovy.grape.Grape.grab(group:'net.sf.ucanaccess', module:'ucanaccess', ver= sion:'3.0.1') sql =3D groovy.sql.Sql.newInstance("jdbc:ucanaccess://"+ System.getenv()['U= SERPROFILE']+ "\\Documents\\bin\\BackupRecords.mdb","net.ucanaccess.jdbc.Uc= anaccessDriver"); sql.eachRow("SELECT pattern FROM FileNamePattern, (SELECT= idFileNamePattern FROM FileNamePatternGroupToFileNamePattern WHERE idFileE= xclusionGroup=3D( SELECT idFileExclusionGroup FROM Directory WHERE director= y=3D:dir)) WHERE id =3D idFileNamePattern=C2=A0 ", [dir:"%USERPROFILE%\\Doc= uments\\WinOOP"]){ println it } The first line does not work well! Can someone show me out to use the class= loader in the groovy console? Unfortunately, the blog that explained how to do this is now gone. ThanksSiegfried ------=_Part_2213371_825129240.1452407141755 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Why does the groovy shel= l require a special syntax?

I'm t= rying to make this work in the groovyConsole.

@GrabConfig(systemClassLoader=3Dtrue)
groovy.grape.Grape.grab(group:'net.sf.ucanac= cess', module:'ucanaccess', version:'3.0.1')
sql =3D groovy.sql.Sql.newInstance("jdbc:ucanaccess://"+ Syste= m.getenv()['USERPROFILE']+ "\\Documents\\bin\\BackupRecords.mdb","net.ucana= ccess.jdbc.UcanaccessDriver"); sql.eachRow("SELECT pattern FROM FileNamePat= tern, (SELECT idFileNamePattern FROM FileNamePatternGroupToFileNamePattern = WHERE idFileExclusionGroup=3D( SELECT idFileExclusionGroup FROM Directory W= HERE directory=3D:dir)) WHERE id =3D idFileNamePattern  ", [dir:"%USER= PROFILE%\\Documents\\WinOOP"]){ println it }

The first line does not work well! Can someone show= me out to use the class loader in the groovy console?

Unfortunately, the blog that explained ho= w to do this is now gone.

Thanks
S= iegfried
------=_Part_2213371_825129240.1452407141755--