<div style="margin-left: 0px">Using MySQL in project and am pretty much repeating this code for every query:</div><div style="margin-left: 0px"><br></div><div style="margin-left: 0px">   spec := (JdmConnectionSpec new initialize</div>
<div style="margin-left: 0px">                              user: &#39;root&#39;; password: &#39;...&#39;</div><div style="margin-left: 0px">                              host: (NetNameResolver addressForName: &#39;...&#39;</div><div style="margin-left: 0px">                              database: &#39;...&#39;</div>
<div style="margin-left: 0px">                              port: ...).</div><div style="margin-left: 0px">   connection := JdmConnection on: spec.</div><div style="margin-left: 0px">   statement := connection createStatement.</div><div style="margin-left: 0px">
   sql := &#39;SELECT * FROM ... WHERE ...&#39;.</div><div style="margin-left: 0px">   resultSet := statement executeQuery: sql.</div><div style="margin-left: 0px">                  ... </div><div style="margin-left: 0px">
   connection close.<br></div><div style="margin-left: 0px"><br></div><div style="margin-left: 0px">If I try to construct a different SQL statement and execute &quot;resultSet := statement executeQuery: sql.&quot; without first executing a &quot;connection close.&quot; then repeating:</div>
<div style="margin-left: 0px"><br></div><div style="margin-left: 0px"><div style="margin-left: 0px">   connection := JdmConnection on: spec.</div><div style="margin-left: 0px">   statement := connection createStatement.</div>
<div style="margin-left: 0px">   sql := &#39;SELECT * FROM ... WHERE ...&#39;.</div><div style="margin-left: 0px">   resultSet := statement executeQuery: sql.</div><div style="margin-left: 0px"><br></div><div style="margin-left: 0px">
it fails.  Am I missing something?</div><div style="margin-left: 0px"><br></div><div style="margin-left: 0px">---John</div></div><div><br></div><div><br></div>