Browsing the archives for the Examples category.

Hibernate Pagination

Examples

The following is an example of Hibernate pagination using the Java persistence libraries:

final Query query  = getEntityManager().createQuery("select n FROM Foo n");
query.setFirstResult(10);
query.setMaxResults(20);
return query.getResultList();
No Comments

Create MySQL Database and User

Examples

Below are the steps to create a MySQL database and add a user

CREATE DATABASE testdb CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON testdb.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY 'sumthin' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON testdb.* TO 'testuser'@'localhost' IDENTIFIED BY 'sumthin' WITH GRANT OPTION;

All commands are executed in the MySQL console.

No Comments
Newer Posts »