Example


-- Table: blog

-- DROP TABLE blog;

CREATE TABLE blog
(
  topic character varying(100),
  id serial NOT NULL,
  CONSTRAINT blog_pkey PRIMARY KEY (id)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE blog OWNER TO postgres;



Configuration.xml


<?xml version="1.0" encoding="UTF-8" ?> 

<!DOCTYPE configuration PUBLIC "-//ibatis.apache.org//DTD Config 3.0//EN" "http://ibatis.apache.org/dtd/ibatis-3-config.dtd"> 

<configuration> 

<environments default="development"> 

<environment id="development"> 

<transactionManager type="JDBC"/> 

<dataSource type="POOLED"> 

<property name="driver" value="${driver}"/> 
<property name="driver" value="org.postgresql.Driver"/> 

<property name="url" value="${url}"/>
<property name="url" value="jdbc:postgresql://localhost:5432/blogdb"/>

<property name="username" value="${username}"/> 
<property name="username" value="postgres"/> 

<property name="password" value="${password}"/> 
<property name="password" value="123456"/> 

</dataSource> 

</environment> 

</environments> 

<mappers> 

<mapper resource="org/apache/ibatis/example/BlogMapper.xml"/> 

</mappers> 

</configuration>







Comments