Examples of JGException


Examples of org.jiql.util.JGException

}catch (Exception ex){
org.jiql.util.JGUtil.olog(ex);
ex.printStackTrace();
tools.util.LogMgr.err("JIQLServlet " + ex.toString());
JGException je = null;
if (ex instanceof JGException)
je = (JGException)ex;
else
je = new JGException(ex.toString());

h.put("error",je);


            resp.setContentType("binary/object");
View Full Code Here

Examples of org.jiql.util.JGException

    public Connection getConnection() throws SQLException {
        //int seconds = 0;
  try{
        if (closed)
            throw new JGException("getConnection:  Data source is closed");
    int wc = 0;
    cfc++;
    if (cfc == 10)
    {
    cfc = 0;
    checkForClosedConnections();
    }
        while (true) {

            synchronized (cons)
      {

                if (!cons.isEmpty())
        {
                    useCountAdd();



          jiqlConnection connection = (jiqlConnection) cons.removeFirst();
                    connection.setClosed(false);

          if (!connection.isClosed())
                      return connection;
          else
          {
          if (debug)
            System.out.println(new java.util.Date() + " Discarding Closed Pool Connection " + connectionsSize() + ":" + getUseCount() + ":" +getActiveCount() );
            activeCountMinus();
            checkForClosedConnections();
            //createConnection();// 737:-717:20
          }

                }
            }
            if ( getActiveCount() < maxCount && creac < maxRC) {
                Connection conn = createConnection();
                useCountAdd();
                return (conn);
            }
      else if (getActiveCount() >= maxCount)System.out.println("Excess jiqlDataSource Connection Objects: " + getActiveCount());
      else if (creac >= maxRC)System.out.println("Excess jiqlDataSource Real Connections: " + creac);

            try {
        if (wc > loginTimeout)
          throw new JGException("DB Login timeout OR too many open DB connections (" + getActiveCount() + ":" + creac + ":" + connectionsSize() + "). Please make sure your calling the close method in the Connection object.");

                Thread.sleep(1000);
                wc++;
            } catch (InterruptedException e) {
                ;
            }

        }

        // We have timed out awaiting an available connection
        //throw new JGException
           // ("getConnection: Timeout awaiting connection");
    }catch (Throwable e){
    org.jiql.util.JGUtil.olog(e);
    e.printStackTrace();
    throw new JGException
        (e.toString());
    }
    }
View Full Code Here

Examples of org.jiql.util.JGException

   }
    public void close() throws SQLException {

        try{
    if (closed)
      throw new JGException("close:  Data Source already closed");

    if (cons == null)
    {
      closed  = true;
      return;
View Full Code Here

Examples of org.jiql.util.JGException


    public void close(int sid) throws SQLException {

        if (closed)
        throw new JGException("close:  Data Source already closed");
    synchronized (cons){

        for (int ct = 0;ct < cons.size();ct++) {
            jiqlConnection conn = (jiqlConnection) cons.get(ct);
      if (conn.hashCode() == sid)
View Full Code Here

Examples of org.jiql.util.JGException

        // Instantiate our database driver
        try {
            Class clazz = Class.forName(driverClass);
            driver = (Driver) clazz.newInstance();
        } catch (Throwable t) {
            throw new JGException("createConnection: " + t);
        }


        closed = false;
View Full Code Here

Examples of org.jiql.util.JGException

    //if (properties == null)
      //setProperties(myprops);
        Connection co = driver.connect(url, properties);
    creac++;
    if (co == null)
      throw new JGException(creac + " Error Creating DB Connection for jiqlDataSource " + url + ":" + driver + ":" + properties);

    return co;
    }catch (NullPointerException nu){
     throw new JGException("NULL Values while creating DB Connection. Please refer to the DataSource topic in the Help Section " + url + ":" + driver + ":" + properties);
    }
    catch (SQLException se){
      System.out.println(se.toString() + " jiqlDataSource.creatTheConnection ERROR " + toString() + ":" + properties);
      throw se;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.