• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to create and use a object of sqlmapclient

 
Pankaj Kaushik Sharma
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
package com.college.beans;

import java.sql.DatabaseMetaData;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

import javax.activation.DataHandler;

import oracle.net.ns.DataPacket;

import com.college.POJO.registerPOJO;
import com.college.dao.RegisterDAO;
import com.college.dao.RegisterDAOImpl;
import com.college.model.Register;
import com.college.model.RegisterImpl;
import com.ibatis.sqlmap.client.SqlMapClient;
public class registerBean extends registerPOJO{

public registerBean() {
super();
add();

// TODO Auto-generated constructor stub
}
public void add()
{
RegisterDAO dao=new RegisterDAOImpl(null);
Register record;
try {
SqlMapClient sqlMapClient = Util.getSqlMapClient();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

try {

reg.getIndexNo();
reg.getAddress();
reg.getCity();
reg.getCountry();
reg.getDob();
reg.getEmailId();
reg.getName();
reg.getPassword();
reg.getUsername();
reg.getState();
reg.setImagePath(null);
record=reg;
dao.insert(sqlMapClient,record);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();

}


}
}
there is a problem of data insertion in my database...
the line dao.insert(sqlMapClient,record); is not working properly...please anybody suggest me how to use and create a sqlmapclient
 
Tom Reilly
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the full error that you are getting.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic