<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: 'root'; password: '...'</div><div style="margin-left: 0px">                          host: (NetNameResolver addressForName: '...'</div><div style="margin-left: 0px">                          database: '...'</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 := 'SELECT * FROM ... WHERE ...'.</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 "resultSet := statement executeQuery: sql." without first executing a "connection close." 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 := 'SELECT * FROM ... WHERE ...'.</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>