Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

com.ibatis.sqlmap.client.SqlMapException: There was an error while buildin

843859Dec 21 2009 — edited Dec 21 2009
Hi
Am very new to iBATIS. Am facing com.ibatis.sqlmap.client.SqlMapException: There was an error while building the SqlMap instance Exception.

below is the SQLMapConfig.xml file:
*<?xml version="1.0" encoding="UTF-8"?>*
*<!DOCTYPE sqlMapConfig*
PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
*"[http://ibatis.apache.org/dtd/sql-map-config-2.dtd]">*

*<sqlMapConfig>*

*<settings useStatementNamespaces="true"/>*

*<transactionManager type="JDBC" commitRequired="false">*
*<dataSource type="SIMPLE">*
*<property name="JDBC.Driver" value="com.mysql.jdbc.Driver"/>*
*<property name="JDBC.ConnectionURL"*
value="jdbc:mysql://localhost:3306/junk"/>
*<property name="JDBC.Username" value="root"/>*
*<property name="JDBC.Password" value=""/>*
*</dataSource>*
*</transactionManager>*

*<sqlMap resource="Contact.xml"/>*

*</sqlMapConfig>*


Contact.xml file:
*<?xml version="1.0" encoding="UTF-8"?>*
*<!DOCTYPE sqlMap*
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
*"[http://ibatis.apache.org/dtd/sql-map-2.dtd]">*

*<sqlMap namespace="Contact">*

*<!--- Inserting data in table -->*

*<insert id="insert" parameterClass="Contact">*
insert into contact (firstName,lastName,email)
values (#firstName#, #lastName#, #email#)
*<selectKey resultClass="int" keyProperty="id">*
select last_insert_id() as id
*</selectKey>*
*</insert>*

*<!--- Showing all data of table -->*

*<select id="getAll" resultClass="Contact">*
select from contact*
*</select>*

*</sqlMap>*


I used jar files:
ibatis-common-2.jar
ibatis-dao-2.jar
ibatis-sqlmap-2.jar
sqljdbc.jar
commons-logging-1.0.4.jar

Please help to rectify the error....
Exception in Detail:


{color:#ff0000}:com.ibatis.sqlmap.client.SqlMapException: There was an error while building the SqlMap instance.--- The error occurred in the SQL Map Configuration file.--- Cause: com.ibatis.sqlmap.client.SqlMapException: XML Parser Error. Cause: java.net.ConnectException: Connection timed out: connectCaused by: java.net.ConnectException: Connection timed out: connectCaused by: com.ibatis.sqlmap.client.SqlMapException: XML Parser Error. Cause: java.net.ConnectException: Connection timed out: connectCaused by: java.net.ConnectException: Connection timed out: connect{color}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 18 2010
Added on Dec 21 2009
1 comment
1,962 views