How to retrieve data from database in java using arraylist?



How to retrieve data from database in java using arraylist?..

Answer / Saurabh Shukla

In Java, you don't directly use ArrayList to retrieve data from a database. Instead, you typically use ResultSet or PreparedStatement objects provided by JDBC (Java Database Connectivity) API. Once the data is retrieved and stored in these objects, you can convert it into an ArrayList if needed.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is meant by 'Class access modifiers'?

1 Answers   HCL,


What is deadlock and how to avoid this?

2 Answers  


What is empty string literal in java?

1 Answers  


Why strings in java are called as immutable?

1 Answers  


Write a regular expression to validate a password. A password must start with an alphabet and followed by alphanumeric characters; its length must be in between 8 to 20.

1 Answers  


What is functional interface in java?

1 Answers  


Can you inherit from an abstract class java?

1 Answers  


What is the benefit of using enum to declare a constant?

1 Answers   Aspire, Infogain,


Can an arraylist be empty?

1 Answers  


How many bytes is string in java?

1 Answers  


What are different types of states exist for a thread?

1 Answers  


Question 6 [9] 6.1 In what situations (in general) would you use a TreeMap? (3) 6.2 In what situations (in general) would you use a HashSet to store a collection of values?

1 Answers  


Categories