I think you're looking for the FOREIGN KEY constraint syntax: http://db.apache.org/derby/docs/10.10/ref/rrefsqlj13590.html
And, more specifically, the REFERENCES syntax: http://db.apache.org/derby/docs/10.10/ref/rrefsqlj16357.html#rrefsqlj16357
So when you are creating the "logintable", at some point in the CREATE TABLE statement you will have something like:
CONSTRAINT login_userid_ref FOREIGN KEY (userid) REFERENCES usertable(userid)
Note that the SQL language has various alternate syntax styles for declaring referential integrity constraints like these; for example you can use a simpler syntax that ends up being something like:
create table logintable(
userid varchar(10) references usertable(userid),
password varchar(20));