I have an application with h2 database. I want to create .sql file using SCRIPT command in Java.
If I am executing it using Prepared Statement:
PreparedStatement stmt = con.prepareStatement("SCRIPT");
ResultSet rs = stmt.executeQuery();
Then how can I able to get whole result in single String. I am new to Java so unable to find the way out to get result of that query because it doesn't contains column names in it.
Then I will write it in file using InputStream.