Home » Author Archives: Ilias Tsagklis (page 30)

Author Archives: Ilias Tsagklis

Ilias Tsagklis
Ilias is a software developer turned online entrepreneur. He is co-founder and Executive Editor at Java Code Geeks.

Get all permissions granted to a loaded class example

With this example we are going to demonstrate how to get all permissions granted to a loaded Class in Java. In short, to get the permissions granted to a Class that is loaded you should: Get the ProtectionDomain of the Class. Create a new ProtectionDomain, using the getProtectionDomain() API method of the Class. Create a PermissionCollection, by getting the permissions ...

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

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 »

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 »

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

Getting column names of a database table

With this example we are going to demonstrate how to get the column names of a database Table. In short, to get the column names of a database Table 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 ...

Read More »

Update a table row example

In this example we shall show you how to update a Table row. To update a Table row 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, String password) ...

Read More »

List all database table names

This is an example of how to list all database table names. Listing all database table names 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 »

Create table example

With this example we are going to create a table in Java. In short, to create a table 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 the ...

Read More »