I want to use JDBC for preparedStatement
in Java for inserting data into a PostgreSQL database. I have the following DDL
CREATE SEQUENCE serial_no;
CREATE TABLE distributors (
did DECIMAL(3) DEFAULT NEXTVAL('serial_no'),
dname VARCHAR(40) DEFAULT 'lusofilms'
);
I want to insert data into this table. Should the PreparedStatement be
INSERT INTO distributors (did,dname) VALUES (?,?);
And if so how do I do insertions in PreparedStatements
for default values?