import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;

public class DbCheck {
    public static void main(String[] args) {
        String url = "jdbc:mariadb://183.98.184.84:3306/madeu";
        String user = "madeu";
        String password = "apdlemdb12#$";

        try {
            Class.forName("org.mariadb.jdbc.Driver");
            try (Connection conn = DriverManager.getConnection(url, user, password);
                    Statement stmt = conn.createStatement();
                    ResultSet rs = stmt.executeQuery("SELECT * FROM medical_divi_list LIMIT 1")) {

                ResultSetMetaData rsmd = rs.getMetaData();
                int columnCount = rsmd.getColumnCount();
                System.out.println("--- COLUMNS IN medical_divi_list ---");
                for (int i = 1; i <= columnCount; i++) {
                    System.out.println(rsmd.getColumnName(i) + " (" + rsmd.getColumnTypeName(i) + ")");
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
