Connection connection = DriverManager.getConnection("jdbc:jtds:sybase://lukas-hp:5000/TEST", "sa", "");
DboFactory create = new DboFactory(connection);
TBook b = T_BOOK.as("b");
TAuthor a = T_AUTHOR.as("a");
TBookStore s = T_BOOK_STORE.as("s");
TBookToBookStore t = T_BOOK_TO_BOOK_STORE.as("t");
Result<Record> result =
create.select(a.FIRST_NAME, a.LAST_NAME, countDistinct(s.NAME))
.from(a)