
Creating a Secure Socket
Java supports creating of ServerSocket(s) in more than one way. This is an important aspect of security. SSLServerSocketFactory is a secure
Java supports creating of ServerSocket(s) in more than one way. This is an important aspect of security. SSLServerSocketFactory is a secure
By default, Spring Boot uses HikariCP as the connection pool. Via the connection pool, we can disable the auto-commit mode.
If em is the EntityManager, then the following query results will be cached: Query query = em .createQuery(“SELECT u FROM
For formatting the SQL statements in a Spring Boot application, we can set hibernate.format_sql in the application.properties as follows: spring.jpa.properties.hibernate.format_sql=
In order to join (combine) fix file paths we can use Path#resolve() and Path#resolveSibling():. // using Path#resolve()Path base1 = Paths.get(“D:/learning/books”);
An approach for sorting a Java collection can rely on Collections.sort() method as in the following example: List names =
Instructing Spring Boot to connect to a database can be done in application.properties via the JDBC URL, user and password
One way to convert a list to an array is shown below: List list = Arrays.asList(1, 2, 3);Integer[] array =
Query methods defined in repositories can be executed asynchronously. This means that the query method will return immediately upon invocation.