Examples of connection()


Examples of org.hibernate.Session.connection()

  }
 
  public void testRawInsert() throws Exception {
    Session session = HibernateUtil.getSession();
    try {
        Connection connection = session.connection();
        Statement statement = connection.createStatement();
        try {
            statement.executeUpdate("insert into o_stat_hourofday (businesspath,resid,hour,value) values ('businesspath',101,2,202)");
            connection.commit();
        }
View Full Code Here

Examples of org.hibernate.Session.connection()

  }
 
  public void testRawInsert() throws Exception {
    Session session = HibernateUtil.getSession();
    try {
        Connection connection = session.connection();
        Statement statement = connection.createStatement();
        try {
            statement.executeUpdate("insert into o_stat_dayofweek (businesspath,resid,day,value) values ('businesspath',101,2,202)");
            connection.commit();
        }
View Full Code Here

Examples of org.hibernate.Session.connection()

  }
 
  public void testRawInsert() throws Exception {
    Session session = HibernateUtil.getSession();
    try {
        Connection connection = session.connection();
        Statement statement = connection.createStatement();
        try {
            statement.executeUpdate("insert into o_stat_daily (businesspath,resid,day,value) values ('businesspath',101,now(),202)");
            connection.commit();
        }
View Full Code Here

Examples of org.hibernate.Session.connection()

  }
 
  public void testRawInsert() throws Exception {
    Session session = HibernateUtil.getSession();
    try {
        Connection connection = session.connection();
        Statement statement = connection.createStatement();
        try {
            statement.executeUpdate("insert into o_stat_weekly (businesspath,resid,week,value) values ('businesspath',101,'2010-03',202)");
            connection.commit();
        }
View Full Code Here

Examples of org.hibernate.classic.Session.connection()

    s.close();

    s = openSession();
    t = s.beginTransaction();

    Connection connection = s.connection();
    PreparedStatement statement = connection.prepareStatement("SELECT * FROM STRANGE_TYPED_OBJECT WHERE ID=?");
    statement.setInt(1, id.intValue());
    ResultSet resultSet = statement.executeQuery();

    assertTrue("A row should have been returned", resultSet.next());
View Full Code Here

Examples of org.hibernate.engine.spi.SessionBuilderImplementor.connection()

        public synchronized Session getS() {
            if (s == null) {
                opened = true;
                SessionBuilderImplementor sessionBuilderImplementor = factoryImplementor.withOptions();
                sessionBuilderImplementor.connection(null);
                sessionBuilderImplementor.flushBeforeCompletion(isAutoFlushEnabled());
                sessionBuilderImplementor.autoClose(isAutoCloseEnabled());
                sessionBuilderImplementor.connectionReleaseMode(factoryImplementor.getSettings().getConnectionReleaseMode());
                return s = sessionBuilderImplementor.openSession();
            }
View Full Code Here

Examples of org.hibernate.engine.spi.SessionImplementor.connection()

    }

    public void setLockTimeout(int timeout) throws SQLException {
        entityManager.getTransaction().begin();
        SessionImplementor session = entityManager.unwrap(SessionImplementor.class);
        Connection connection = session.connection();
        connection.createStatement().execute("CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.locks.waitTimeout', '" + timeout + "')");
        entityManager.getTransaction().commit();
    }

}
View Full Code Here

Examples of org.hibernate.internal.SessionImpl.connection()

    PreparedStatement ps = null;
    ResultSet rs = null;
    SessionImpl session = null;
    try{
      session = ((SessionImpl)getEntityManager().getDelegate());
      conn = session.connection();
      ps = conn.prepareStatement(sql);
      rs = ps.executeQuery();
      while(rs.next()){
        return rs.getLong(1);
      }
View Full Code Here

Examples of org.hibernate.search.FullTextSession.connection()

  public void testBatchSize() throws Exception {
    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx = s.beginTransaction();
    int loop = 14;
    for (int i = 0; i < loop; i++) {
      Statement statmt = s.connection().createStatement();
      statmt.executeUpdate( "insert into Domain(id, name) values( + "
          + ( i + 1 ) + ", 'sponge" + i + "')" );
      statmt.executeUpdate( "insert into Email(id, title, body, header, domain_id) values( + "
          + ( i + 1 ) + ", 'Bob Sponge', 'Meet the guys who create the software', 'nope', " + ( i + 1 ) +")" );
      statmt.close();
View Full Code Here

Examples of org.jooq.ExecuteContext.connection()

    }

    private final int[] executePrepared() {
        ExecuteContext ctx = new DefaultExecuteContext(configuration, new Query[] { query });
        ExecuteListener listener = new ExecuteListeners(ctx);
        Connection connection = ctx.connection();

        // [#1371] fetch bind variables to restore them again, later
        DataType<?>[] paramTypes = dataTypes(query.getParams().values().toArray(new Field[0]));

        try {
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.