import java.sql.*; public class OracleJdbcExample { public static void main(String[] args) { String jdbcUrl = "jdbc:oracle:thin:@//localhost:1521/xe"; // Replace with your Oracle connection URL String username = "biswajit"; // Replace with your username String password = "12345"; // Replace with your password try { // Load the Oracle JDBC driver Class.forName("oracle.jdbc.driver.OracleDriver"); // Establish a connection to the Oracle database Connection connection = DriverManager.getConnection(jdbcUrl, username, password); // Create a statement object Statement statement = connection.createStatement(); // Execute a SQL query String sqlQuery = "SELECT * FROM EMP"; // Replace with your table name ResultSet resultSet = statement.executeQuery(sqlQuery); // Process the query results while (resultSet.next()) { // Assuming your_table has a column named "column_name" String value = resultSet.getString("column_name"); System.out.println(value); } // Clean up resources resultSet.close(); statement.close(); connection.close(); } catch (ClassNotFoundException e) { System.out.println("Oracle JDBC driver not found"); e.printStackTrace(); } catch (SQLException e) { System.out.println("Failed to connect to the database"); e.printStackTrace(); } } }