Code examples for Statement

Codota analyzed 7,668,838 open source code samples to find the most common, credible and clear examples.
You can now enable Codota on your own code to easily search and navigate your Java codebase.
17:	rs = st.executeQuery(query); 
-
33:	st.close(); 
Full Snippet Info
8
CodeRank
172:	stmt.setQueryTimeout(timeoutSeconds); 
-
174:	rs = stmt.executeQuery(query); 
-
193:	DBHelper.close(rs, stmt, null); 
Full Snippet Info
8
CodeRank
48:	ResultSet rs = stat.executeQuery(sql); 
Full Snippet Info
8
CodeRank
303:	statement.execute(DatabaseCreator.INSERT_SALESPEOPLE1); 
304:	statement.execute(DatabaseCreator.INSERT_SALESPEOPLE2); 
305:	statement.execute(DatabaseCreator.INSERT_SALESPEOPLE3); 
306:	statement.execute(DatabaseCreator.INSERT_SALESPEOPLE4); 
307:	statement.execute(DatabaseCreator.INSERT_SALESPEOPLE5); 
308:	statement.execute(DatabaseCreator.INSERT_SALESPEOPLE6); 
Full Snippet Info
8
CodeRank
50:	statement.close(); 
Full Snippet Info
7
CodeRank
68:	DataSourceUtils.applyTransactionTimeout(stmt, getDataSource()); 
69:	rs = stmt.executeQuery(getSequenceQuery()); 
-
82:	JdbcUtils.closeStatement(stmt); 
Full Snippet Info
7
CodeRank
34:	st.execute("CALL SYSCS_UTIL.SYSCS_CHECKPOINT_DATABASE()"); 
-
40:	st.close(); 
Full Snippet Info
7
CodeRank
197:	statement.executeUpdate(query); 
198:	statement.close(); 
Full Snippet Info
8
CodeRank
40:	stmt.execute("create table folder (id int, name varchar(100), parent_id int)"); 
-
43:	stmt.execute("insert into folder (id, name) values(1, 'Root')"); 
44:	stmt.execute("insert into folder values(2, 'Folder 1', 1)"); 
45:	stmt.execute("insert into folder values(3, 'Folder 2', 1)"); 
46:	stmt.execute("insert into folder values(4, 'Folder 2_1', 3)"); 
47:	stmt.execute("insert into folder values(5, 'Folder 2_2', 3)"); 
Full Snippet Info
7
CodeRank
455:	resource.close(); 
Full Snippet Info
7
CodeRank
101:	s.execute(KEYS_TABLE); 
102:	s.execute(KEYS_TABLE_USER_ID_INDEX); 
103:	s.execute(KEYS_TABLE_KEY_INDEX); 
104:	s.execute(KEYS_TABLE_USER_ID_KEY_INDEX); 
105:	s.execute(KEYS_TABLE_LAST_SEEN_INDEX); 
Full Snippet Info
7
CodeRank
101:	stmt.execute(ddl); 
102:	SQLWarning warn = stmt.getWarnings(); 
-
107:	long ucount = stmt.executeUpdate(dml); 
-
110:	ResultSet rs = stmt.executeQuery(query); 
-
123:	stmt.execute("SHUTDOWN;"); 
Full Snippet Info
7
CodeRank
313:	final int updateResult = statement.executeUpdate(query); 
-
315:	statement.close(); 
Full Snippet Info
7
CodeRank
65:	stmt.closeOnCompletion(); 
-
67:	stmt.execute(TestUtil.selectSQL("table1", "*") + ";" + 
-
69:	ResultSet rs = stmt.getResultSet(); 
-
71:	assertFalse(stmt.isClosed()); 
72:	stmt.getMoreResults(); 
73:	rs = stmt.getResultSet(); 
-
75:	assertTrue(stmt.isClosed()); 
Full Snippet Info
7
CodeRank
85:	int i = hsqlStmt.executeUpdate(table1Stmt); 
-
87:	i = hsqlStmt.executeUpdate(table2Stmt); 
-
89:	i = hsqlStmt.executeUpdate(insert1Stmt); 
-
91:	i = hsqlStmt.executeUpdate(insert2Stmt); 
-
93:	i = hsqlStmt.executeUpdate(insert3Stmt); 
-
95:	hsqlStmt.close(); 
Full Snippet Info
7
CodeRank
76:	obj.close(); 
Full Snippet Info
7
CodeRank
57:	statement.execute("DROP SCHEMA PUBLIC CASCADE"); 
-
59:	statement.executeUpdate("create table TABLE_A (value varchar(1))"); 
60:	statement.executeUpdate("create table TABLE_B (value varchar(1))"); 
61:	statement.executeUpdate("insert into TABLE_A(value) values('n')"); 
62:	Thread.sleep(10000); //TODO DZ: sleeps in tests are not ideal 
63:	ResultSet resultSet = statement.executeQuery("select count(*) from TABLE_B where value='y'"); 
-
68:	statement.execute("DROP SCHEMA PUBLIC CASCADE"); 
Full Snippet Info
7
CodeRank
267:	statement.execute("INSERT INTO " + FKSTRICT_TABLE 
-
269:	statement.execute("INSERT INTO " + FKSTRICT_TABLE 
-
271:	statement.execute("INSERT INTO " + FKSTRICT_TABLE 
Full Snippet Info
7
CodeRank
44:	stat.execute("CREATE TABLE TABLE_WORD (" + 
-
50:	stat.execute("REPLACE INTO TABLE_WORD " + 
-
52:	stat.execute("REPLACE INTO TABLE_WORD " + 
-
54:	stat.execute("REPLACE INTO TABLE_WORD " + 
-
57:	rs = stat.executeQuery("SELECT WORD " + 
-
62:	stat.execute("REPLACE INTO TABLE_WORD " + 
-
64:	rs = stat.executeQuery("SELECT WORD FROM TABLE_WORD where WORD_ID = 1"); 
Full Snippet Info
7
CodeRank
119:	s.execute(TablesDerby.FRIENDS_TABLE); 
120:	s.execute(FRIENDS_TABLE_UID_INDEX); 
121:	s.execute(FRIENDS_TABLE_FID_INDEX); 
122:	s.execute(FRIENDS_TABLE_UID_FID_INDEX); 
Full Snippet Info
7
CodeRank