i am having some connectivvity issues i am using postgres 9.0 sql db
i have installed a dns localhost using the postgres sql driver
also i have the jdbc jar files in the lib dir of the tomcat
my code is
<%@ page language="java" import="java.sql.*" %>
<%
Class.forName("org.postgresql.Driver");
Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5432/sample", "postgres", "ankur");
Statement stmt = conn.createStatement();
String StrUser = request.getParameter("username");
String Age = request.getParameter("age");
stmt.executeUpdate("INSERT INTO tab1 VALUES ('ankur',21);" );
stmt.close();
conn.close();
%>
the error generated is
avax.servlet.ServletException: org.postgresql.util.PSQLException: ERROR: syntax error at or near "["
Position: 18