I have some Java code like
int userid = take user input;
And then execute following sql statement,
Class.forName(dbdriver);
conn = DriverManager.getConnection(url, username, password);
st = conn.createStatement();
st.executeUpdate("select * from person where uid = userid" );
Now, I don’t know the returned result is null. I think where uid = userid is giving wrong result because it is searching for literal uid value “userid”. Actually, I want to retrive information from person table about user provided uid values. Can anybody help me how to solve this?
1 Answer