المستند
المستند
ArrayList:
import java.util.*;
public class Task1
{
public static void main (String [] args)//The place where the program starts
{
ArrayList<String>n1=new ArrayList<>();
n1.add("Akthm");
n1.add("Nasra");
n1.add("Rayan");
System.out.print(n1);
n1. remove("Akthm");
System.out.print("after removal");
System.out.print(n1);//In Java, the value of variable n1 is printed to the console.
Input:
Output:
Vector:
A vector has the ability to grow or shrink in size, much like a dynamic
array. It has no size restrictions, unlike conventional arrays, and can hold
an infinite amount of elements. It was first included in Java 1.2's Java
Collection framework.
Vector:
import java.util.*;
public class Java2
{
}
}
Input:
Output:
Q2:
1
3
4
5
6
Q5:
By enrolling in the program course entitled “Java Database Connection: JDBC, My
SQL”.
To begin with, familiarise yourself with the idea of JDBC, which lets Java
programmers connect to relational databases. The fact that it offers access to
numerous databases is an additional benefit. There is very little link to the database.
Complex SQL applications (internal and external connections). and make use of
cached routines. Furthermore, databases (SQL server, DB2, Oracle, etc.) are
supported by GDBC.Additionally, I discovered that a particular database receives
JDBC calls through the JDBC driver. JDBC Driver Manager loads the JDBC driver
automatically in JDBC 4.0 by using the class path. The same steps connect to the
database, create an object, run a SQL query, and then process the dataset are followed
in both the development and build processes. In addition, I gained knowledge about
configuring our development environment and adding a new user to the database. A
number of topics were raised. System requirements come first, followed by
downloading the spreadsheet, installation instructions for the JDBC driver, and testing
the database connection. I gained familiarity with the idea of a statement statement,
which is a pre-compiled SQL that is permanent. The ability to set SQL parameter
values more easily is one of the many advantages of prepared statements. The
performance of a precompiled SQL statement may be improved by this. I also gained
knowledge about stored procedures, which are collections of SQL built in the SQL
language and supported by native databases that may have any mix of input and
output parameters. They are used to carry out particular tasks. Results can be returned
by a stored procedure. As you now know, a transaction is a single transactional work
unit. You gained knowledge of how to read and write binary large objects, or BLOBs,
which are collections of binary data kept together in a single file.Usually used to
papers, audio files, and photographs. The employee's resume is added initially,
followed by reading the local PDF file and updating the database with binary data.
Character data is kept in clops (uppercase character objects), which can be read and
written. Big text documents are stored there. The only way it varies from BLOB in
writing is that it adds text data updates to the database.