Package org.hibernate

Examples of org.hibernate.Session.connection()


            session = getSession();
            if (session == null) {
                session = _sessionFactory.openSession();
                sessionOpened = true;
            }
            session.connection().createStatement().execute("SHUTDOWN COMPACT");
        }
        catch (HibernateException e) {
            WGFactory.getLogger().error("Error shutting down HSQL database", e);
        }
        catch (SQLException e) {
View Full Code Here


              } else {
                readOnly = !isUpdateInProgress(authSession.getDistinguishedName());
              }
             
              try {
          session.connection().setReadOnly(readOnly);
                }
                catch (SQLException e) {
          throw new WGBackendException("Unable to set readonly flag on connection." , e);
        }
            }
View Full Code Here

    Connection conn = null;
    Session session = null;
    try {

      session = getHibernateTemplate().getSessionFactory().openSession();
      conn = session.connection();
      CallableStatement cs = conn.prepareCall("{? =  call GET_SALDO_PARTITA( ?, ?, ?, 0, ?, SYSDATE ) }");
      cs.registerOutParameter(1, Types.DOUBLE);
      cs.setLong(2, conto);
      cs.setInt(3, numeroPam.intValue());
      cs.setInt(4, progressivoRata.intValue());
View Full Code Here

    Connection conn = null;
    Session session = null;
    try {

      session = getHibernateTemplate().getSessionFactory().openSession();
      conn = session.connection();
      CallableStatement cs = conn.prepareCall("{? =  call CALCOLA_MORA( ?, ?, ? ) }");
      cs.registerOutParameter(1, Types.DOUBLE);
      cs.setLong(2, mutuo);
      cs.setInt(3, progressivoRata.intValue());
      cs.setDate(4, new java.sql.Date(dataRiferimento.getTime()));
View Full Code Here

    Connection conn = null;
    Session session = null;
    try {

      session = getHibernateTemplate().getSessionFactory().openSession();
      conn = session.connection();
      CallableStatement cs = conn.prepareCall("{? =  call GET_IMPRIMBORSO( ?, ? ) }");
      cs.registerOutParameter(1, Types.DOUBLE);
      cs.setLong(2, nrMutuo);
      cs.setDate(3, new java.sql.Date(dataRiferimento.getTime()));
View Full Code Here

   * @throws SQLException in case the inset fails.
   */
  private TShirt createObjectWithSQL() throws SQLException {
    Session s = openSession();
    s.getTransaction().begin();
    Statement statement = s.connection().createStatement();
    statement.executeUpdate(
        "insert into TShirt_Master(id, logo, size) values( '1', 'JBoss balls', 'large')"
    );
    statement.close();
    TShirt ts = ( TShirt ) s.get( TShirt.class, 1 );
View Full Code Here

    s.close();

    assertEquals( "rollback() should not index", 3, getDocumentNumber() );

    s = getSessions().openSession();
    s.connection().setAutoCommit( true )// www.hibernate.org/403.html
    s.persist(
        new Document(
            "Java Persistence with Hibernate", "Object/relational mapping with Hibernate", "blah blah blah"
        )
    );
View Full Code Here

    author.setName( "Moo Cow" );
    sess.persist( author );

    tx.commit();
    sess.clear();
    Statement statement = sess.connection().createStatement();
    statement.executeUpdate( "DELETE FROM Author" );
    statement.close();
    FullTextSession s = Search.getFullTextSession( sess );
    tx = s.beginTransaction();
    QueryParser parser = new QueryParser( "title", new KeywordAnalyzer() );
View Full Code Here

    logger.debug("IN");
    //Start writing log in the DB
    Session aSession =null;
    try {
      aSession = HibernateUtil.currentSession();
      Connection jdbcConnection = aSession.connection();
      IEngUserProfile profile = UserUtilities.getUserProfile();
      AuditLogUtilities.updateAudit(jdbcConnection,  profile, "activity.HotLinkMenu", null);
    } catch (HibernateException he) {
      throw new EMFUserError(EMFErrorSeverity.ERROR, 100);
    } finally {
View Full Code Here

      logger.debug("Filling report ...");
      Context ctx = new InitialContext();
      Session aSession = HibernateUtil.currentSession();
      Transaction tx = aSession.beginTransaction();
      Connection jdbcConnection = aSession.connection();
      JasperPrint jasperPrint = JasperFillManager.fillReport(dirS + File.separatorChar + "Master.jasper", parameters,jdbcConnection);
      logger.debug("Report filled succesfully");
         if (aSession != null) {
            if (aSession.isOpen()) aSession.close();
           }
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.