Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

 

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

 

and many more ....

 

 

Check if a permission implies another permission example

In this example we shall show you how to check if a permission to a file implies another permission. To check the permissions to a specific file one should perform the following steps: Create a new FilePermission with a given String as path and another given String as actions. Create a second FilePermission with a another String as path and ...

Read More »

Control access to an Object example

With this example we are going to demonstrate how to control access to an Object in Java. In short, to control access to an Object you should: Create a Guard, which is an object that is used to protect access to another object, with the String name of the system property, and a String of comma-separated actions granted on the ...

Read More »

Check read/write permission for a directory example

This is an example of how to check read/write permission for a directory. Checking read/write permission for a directory implies that you should: Create a FilePermission for the pathname of the directory, and a comma-separated list of the actions granted on the directory. Invoke the checkPermission(Permission perm) API method of the AccessController, in order to check whether the access request ...

Read More »

Generate a secure random number example

In this example we shall show you how to generate a secure random number. To generate secure random numbers one should perform the following steps: Create a SecureRandom for the SHA1PRNG algorithm, which is a secure number generator, using the getInstance(String algorithm) API method. Create a new byte array with a specific length (128 in the example). Invoke the nextBytes(byte[] ...

Read More »

Determine if a ResultSet is updatable

With this example we are going to demonstrate how to determine if a ResultSet is updatable. An updatable ResultSet is a table of data representing a database result set, that can be updated by others. In short, to determine if a ResultSet is updatable you should: Load the JDBC Driver, using the forName(String className) API method of the Class. In ...

Read More »

Determine if a database supports Updatable ResultSets

This is an example of how to determine if a database supports updatable ResultSets. When a database supports updatable ResultSets it means that modification to data in a table is allowed through a result set. Checking if a database supports updatable ResultSets implies that you should: Load the JDBC driver, using the ForName(String className) API method of the Class. In ...

Read More »

Updatable ResultSet Example

In this example we shall show you how to use an updatable ResultSet. An updatable result set allows modification to data in a table through the result set. To create an Updatable ResultSet and use its capabilites for data updates in a database one should perform the following steps: Load the JDBC driver, using the forName(String className) API method of ...

Read More »

Determine if a database supports Scrollable ResultSets

With this example we are going to demonstrate how to determine if a database supports scrollable ResultSets. Values captured in an insentitive scrollable result set never change, even if changes are made to the table from which the data was retrieved, whereas a sensitive scrollable result set is one where the current values in the table are reflected in the ...

Read More »

Determine if a ResultSet is scrollable

This is an example of how to determine if a ResultSet is Scrollable. Checking if a ResultSet is scrollable or not implies that you should: Load the JDBC driver, using the forName(String className) API method of the Class. In this example we use the MySQL JDBC driver. Create a Connection to the database. Invoke the getConnection(String url, String user, String ...

Read More »

Scrollable ResultSet example

In this example we shall show you how to create and use a scrollable ResultSet. To use a scrollable ResultSet one should perform the following steps: Load the JDBC driver, using the forName(String className) API method of the Class. In this example we use the MySQL JDBC driver. Create a Connection to the database. Invoke the getConnection(String url, String user, ...

Read More »