This is where you need to provide all configurations for iBatis. Create an XML file with name SqlMapConfig.xml Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments on this post Print for later Bookmark in Browser Tell a friend
Aug
09
How to redirect a page to a subdomain ?
In case you want to redirect a URL on URL domain to your subdomain or another URL , There are many ways you can do it Technique 1 Open the file .htAccess file present in /public_html/yourDomain folder using an ftp client . Add an entry in it as follows :Redirect 301 /oldPath http://www.subdomain.yourdomain.com/ To move… Continue reading »
Aug
08
Ibatis Tutorial – Sample Application Step 3
Step 3: Create struts-config.xml <?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> <transactionManager type=”JDBC”> <dataSource type=”SIMPLE”> <property name=”JDBC.Driver” value=”com.mysql.jdbc.Driver”/> <property name=”JDBC.ConnectionURL” value=”jdbc:mysql://localhost:3306/employeedb”/> <property name=”JDBC.Username” value=”root”/> <property name=”JDBC.Password” value=””/> </dataSource> </transactionManager> <sqlMap resource=”com/Employee.xml”/> </sqlMapConfig> Also Read : IBatis vs Hibernate ? Which one to choose? IBatis Tutorial – Sample Application Step… Continue reading »
Aug
08
IBatis Tutorial – Sample Application Step 4
Create Employee.xml <?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> <select id=“getEmployee” parameterClass=“int” resultClass=“com.Contact”> SELECT employeeID as employeeID, firstName as firstName, lastName as lastName, email as email from Employee where employeeID=#value# </select> <select id=“getEmployees” resultClass=“com.Employee”> SELECT employeeID as employeeID, firstName as firstName, lastName as lastName, email as email from Employee… Continue reading »
Aug
08
Ibatis Tutorial – Sample Application Step 5
Step 5 : Create a standalone java class to run the application . import java.io.Reader; import java.util.List; import com.ibatis.common.resources.Resources; import com.ibatis.sqlmap.client.SqlMapClient; import com.ibatis.sqlmap.client.SqlMapClientBuilder; import com.model.Employee; public class QueryEmployee { public static void main(String[] args) { try { String resource = “SqlMapConfig.xml”; Reader reader = Resources.getResourceAsReader(resource); SqlMapClient sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader); Integer employeePrimaryKey = new Integer(1); Employee… Continue reading »
Aug
08
IBatis Tutorial Part 3 – SQLMapConfig.xml optional settings
Here are some of the options setting which are worth mentioning. <settings maxRequests =”120″ maxSessions =”20″ maxTransactions=”10″ lazyLoadingEnabled =” true” enhancementEnabled =”true” cacheModelsEnabled =”true” useStatementNamespaces =”false” defaultStatementTimeout =”5″ /> <typaAlias alias = “”employee> type =”com.Emloyee” /> Settings attributes : Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet… Continue reading »
Aug
08
Introduction to IBatis Tutorial -Part 1
This is a tutorial on IBatis . IBatis is a persistence framework which enables mapping SQL queries to POJOs (Plain Old Java Objects). The SQL queries are decoupled from an application by putting the queries in XML files. Mapping of the retrieved objects is automatic or semi-automatic. IBatis couples objects with stored procedures or SQL… Continue reading »
