Home » Archives for Byron Kiourtzoglou » Page 30

Author Archives: Byron Kiourtzoglou

Byron is a master software engineer working in the IT and Telecom domains. He is an applications developer in a wide variety of applications/services. He is currently acting as the team leader and technical architect for a proprietary service creation and integration platform for both the IT and Telecom industries in addition to a in-house big data real-time analytics solution. He is always fascinated by SOA, middleware services and mobile development. Byron is co-founder and Executive Editor at Java Code Geeks.

Generate Public/Private key pairs for DSA DH RSA algorithm example

With this example we are going to demonstrate how to generate private/public key pairs for the DSA, the DH and the RSA algorithms. In short, to generate key pairs for these three algorithms you should: Create a KeyPairGenerator for the DSA algorithm, using the getInstance(String algorithm) API method and initialize it with a 1024-bit key size. Generate the KeyPair, with ...

Read More »

Enable the security manager example

This is an example of how to enable the Security Manager in Java. Since no security manager is enabled by default, and all security checks to protected resources and operations are disabled, enabling the security manager implies that you should: Create a new SecurityManager Object. Invoke the setSecurityManager(SecurityManager s) API method of the System, in order to enable the new ...

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 »

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 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 »

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 »

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 »

Retrieve data example

This is an example of how to retrieve data from a database. Retrieving data from a database 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 password) API method of ...

Read More »

Insert a row into a table example

With this example we are going to demonstrate how to insert a row into a table. We can insert rows to a table with the Statement or the PreparedStatement API, according to the frequency of inserted rows. In short, to insert a row into a table you should: Load the JDBC driver, using the forName(String className) API method of the ...

Read More »