Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Fail to run Tutorial Adding Persistence With JDBC (Java Web SDK)


I followed this tutorial SAP HANA Cloud Platform and successfully run this application on HCP.

Then, I 'm trying to get data from my backend system via RFC and saving these data on HCP using Persistence With JDBC  service.

I have successfully got the data(backend system information). However when I was going to save the date on HCP, there is an exception

HTTP Status 500 - org.apache.commons.dbcp.SQLNestedException: Borrow prepareStatement from pool failed.

My codes is almost the same as SAP HANA Cloud Platform, and there is only few changes. I'm sure that this problem happened when application run in red line, but I don't know why it is different from the tutorial? Can anyone help me to solve this problem?

Best Regard,


Here are my codes:


private SystemInfoDAO sInfoDAO;

public void init() throws ServletException{


  InitialContext ctx = new InitialContext();

  DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/DefaultDB");

sInfoDAO = new SystemInfoDAO(ds);

  }catch(SQLException e){

  throw new ServletException(e);

  }catch(NamingException e){

  throw new ServletException(e);



SystemInfoDAO :

public class SystemInfoDAO {

  private DataSource dataSource;

  public SystemInfoDAO(DataSource newdatasource) throws SQLException{



  public void setDataSource(DataSource newdatasource) throws SQLException{

  this.dataSource = newdatasource;



  public DataSource getDataSource(){

  return dataSource;


  public void addSystemInfo(SystemInfo systeminfo) throws SQLException{

  Connection connection = dataSource.getConnection();


  PreparedStatement pstmt = connection.prepareStatement("INSERT INTO SYSTEMINFOS (INFO) VALUES (?)");

  pstmt.setString(1, systeminfo.getInfo());



  if(connection != null){


Former Member
Not what you were looking for? View more on this topic or Ask a question