Fri, 17 May 2024


How to run an SQL Select query using JDBC?

By: Nathalie, NetArt Media
Tue, 14 July 2020

A SQL SELECT query is used to get data from a table. The results of the select query is called a result set.

try
{
// Create a result set containing all data from my_table
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM my_table");

}

catch (SQLException e)

{

}


Category: Web Development
Share this post:



See All Scripts






Subscribe for our newsletter

Receive the latest blog posts direct in your mailbox