Able to connect to Postgre sql database

I am able to test connection once downloaded pgAdmin and create a test postgre database as you can see

hello,

ok, but with handling this db by testcase you have yo write code where will get connection and lot of other stuffs

	@Keyword
	public int getRowCount(){

		int count = 0
		try {
			Class.forName("org.postgresql.Driver");
			c = DriverManager
					.getConnection("jdbc:postgresql://"+host+":5432/"+db,user,pass);
			c.setAutoCommit(false);
			stmt = c.createStatement();
			ResultSet r = stmt.executeQuery("SELECT COUNT(*) AS rowcount FROM COMPANY");
			r.next();
			count = r.getInt("rowcount");
			r.close();
			System.out.println("MyTable has " + count + " row(s).");
		} catch (Exception e) {
			e.printStackTrace();
			System.err.println(e.getClass().getName()+": "+e.getMessage());
			System.exit(0);
		}
		System.out.println("Opened database successfully");
		return count
	}

I was able to retrieve data by using this methods: