how to join multiple table in java using eclips -
if write code this
preparedstatement pre1=cn.preparestatement("insert registration(name,contactno,lid)values(?,?,'select lid login email="+email+" , password="+pass+"'");
its give error incorrect syntax near 'select lid login email="" , password=1233456'.
please me remove error
i think you're looking subquery. , can bind email , password too. also, should close
statement
(s). like,
string sql = "insert registration(name,contactno,lid) values " + "(?,?,(select lid login email=? , password=?))"; preparedstatement pre1 = null; try { pre1 = cn.preparestatement(sql); // ... pre1.setstring(3, email); pre1.setstring(4, pass); } catch (exception e) { e.printstacktrace(); } { if (pre1 != null) { try { pre1.close(); } catch (exception e) { e.printstacktrace(); } } } }
Comments
Post a Comment