i tried connecting to h2 and i succeded, but when i tried to retrive the
schemas, i cannot retrive the table and schemas i created. what was the
issue, below was my code and screen shot of db
package h2;
import java.io.FileInputStream;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
import java.util.Scanner;
public class jdbc {
public static void main(String args[]) {
try {
Class.forName("org.h2.Driver");
Connection con =
DriverManager.getConnection("jdbc:h2:C:/Users/P3/lakshmi","sa", "secret");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM PUBLIC.CUSTOMER");
while(rs.next())
{
System.out.println(rs.getString(2));
}
con.close();
} catch (Exception e) {
System.out.println(e);
}
}
}
<https://lh3.googleusercontent.com/-QTIljPMcbPM/WO3vz1YAVMI/AAAAAAAAAAg/qOoJ1j6hvXk_HWG3jSDdGJD_f_2iFTbqgCLcB/s1600/Captur1e.PNG>
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.