coderz.py

Keep Coding Keep Cheering!

File class in Java

The File class represents a file or directory path name in Java. Because file and directory names differ between platforms, naming them with a simple string is insufficient. The File class is used to create files and directories, search for files, delete files, and so on. Fields of File Class Modifier Type Field Description static String pathSeparator It is a path-separator character that is system-dependent and is represented as a string for convenience. static char pathSeparatorChar It is a path-separator character that is system-dependent. static […]

September 7, 2022 | Java | No comments

Inner class in Java

In Java, an inner class is a class that is declared within another class or interface. To summarize, the same logically related classes as Java is purely object-oriented, bringing it closer to the real world.It also has access to all the outer class’s members, including private data members and methods. Syntax: Why do we use […]

September 6, 2022 | Java | No comments

Java connectivity to MongoDB database

MongoDB is a no-SQL database that is document-oriented. MongoDB, which was first released in 2009, successfully replaced rows and columns in traditional relational data models with documents. We do not need to use the JDBC API to connect to MongoDB because its API is completely independent and does not require any other external library. Prerequisites: […]

September 5, 2022 | Java | No comments

Using the Thin Driver to Connect to an Oracle Database

Follow the steps below to connect a Java application to an Oracle database using Thin Driver. Download Oracle JDBC Driver Load Driver Class JDBC Connection Load the jar file Download Oracle JDBC Driver: Visit Oracle database website and download the Oracle JDBC Driver. Load Driver Class: The Oracle database Driver Class is oracle.jdbc.driver.OracleDriver and the Class.forName(“oracle.jdbc.driver.OracleDriver”) method […]

September 5, 2022 | Java | No comments

Java connect to MySQL database with JDBC

Follow the steps below to connect a Java application to a MySQL database using the JDBC Driver. Download JDBC driver for MySQL No need to load MySQL driver class explicitly Understand the getConnection() method of DriverManager class Java code example connects to MySQL database Download JDBC driver for MySQL: To begin, a JDBC driver for […]

September 4, 2022 | Java | No comments

Java Database Connectivity

To connect any Java application to a database using JDBC, follow these five steps. These are the steps to take: Register the Driver class Create connection Create statement Execute queries Close connection Register the driver class: The Class class’s forName() method is used to register the driver class. This method is used to load the […]

September 2, 2022 | Java | No comments

JDBC API(java.sql Package)

The Java Database Connectivity (JDBC) API allows Java programmers to access data from any database. You can use the JDBC API to access almost any data source, from relational databases to spreadsheets and flat files. JDBC technology also provides a common foundation for the development of tools and alternate interfaces. Packages of JDBC API: The […]

September 2, 2022 | Java | No comments

What is JDBC?

JDBC (Java Database Connectivity) is the Java API for connecting to a database, issuing queries and commands, and handling database result sets. It is a component of JavaSE (Java Standard Edition). JDBC API connects to the database using JDBC drivers. JDBC is fundamentally a specification that provides a comprehensive set of interfaces for mobile access […]

September 1, 2022 | Java | No comments

Remote Method Invocation(RMI) in Java

Remote Method Invocation (RMI) is an API that allows an object to call a method on another object in another address space, which could be on the same machine or another machine. RMI enables remote communication between Java programs and is used to create distributed applications. It is provided in the package java.rmi. RMI Application Architecture: […]

August 31, 2022 | Java | No comments

Java.lang.Class class in Java

Java includes a class called Class in the java.lang package. In a running Java application, instances of the class Class represent classes and interfaces. Class objects also represent the primitive Java types (boolean, byte, char, short, int, long, float, and double), as well as the keyword void. It has no public builder. The Java Virtual […]

August 29, 2022 | Java | No comments

Advertisement