A Matter of Understanding
by Remy Porter
in CodeSOD
on 2024-11-04
For years, Victoria had a co-worker who "programmed by Google Search"; they didn't understand how anything worked, they simply plugged their problem into Google search and then copy/pasted and edited until they got code that worked. For this developer, I'm sure ChatGPT has been a godsend, but this code predates its wide use. It's pure "Googlesauce".
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("SELECT * FROM TABLE1 WHERE COLUMN1 = 1 WITH UR");
String sqlStr = stringBuffer.toString();
ps = getConnection().prepareStatement(sqlStr);
ps.setInt(1, code);
rs = ps.executeQuery();
while (rs.next())
{
count++;
}