Pgsql_DropCreateTable1
Using
  • Drop If Exists
     
    String sql2= "drop table if exists visitor11;";
    String sql3 ="Select * from visitor11";
     
  • Create Table visitor11
    String sqlCreate = "create table pgsVisitor1B (" +"id NUMERIC(3) CONSTRAINT PK_V1B PRIMARY KEY,"
    + "fname varchar(30)," + "lname varchar(30),"
    + "age numeric(2)) ";
     
  • Complete Code : Pgsql_DropCreateTable1.txt
Snapshot of pgsAdmin II before Creating table pgsVisitor1B

Snapshot from NetBean 8.0

 Create table , Insert data , get column's name:

print visitor table

The table and data were added to the current schema

 
Querying table with PgSQL :

 
With NET Bean 8.0 output pane:

Viewing with PHP code :