Skip to content

Instantly share code, notes, and snippets.

@nikhil3000
Last active June 24, 2020 17:50
Show Gist options
  • Save nikhil3000/6265f3d44316f3d3752973c1c78b683a to your computer and use it in GitHub Desktop.
Save nikhil3000/6265f3d44316f3d3752973c1c78b683a to your computer and use it in GitHub Desktop.
public interface MyDAO {
@SqlUpdate("create table userData (id int primary key, name varchar(100))")
void createUserTable();
@SqlUpdate("insert into userData (id, name) values (:id, :name)")
void insert(@Bind("id") int id, @Bind("name") String name);
@SqlQuery("select name from userData where id = :id")
String findNameById(@Bind("id") int id);
@SqlQuery("select name from userData")
List<String> getAllNames();
@SqlQuery("select name from userData where id 1")
String testQuery();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment