Best code examples for Java 8 Connection class (java.sql.Connection)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Connection class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Java 8 Connection examples from Open Source projects
This code example shows how to use the following methods: close
60:	conn.close(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: createStatement
47:	Statement stat = conn.createStatement(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: close
155:	target.close(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: close, prepareStatement
65:	conn.close(); 
-
74:	pstmt = conn 
-
83:	pstmt = conn.prepareStatement("select id from vm_template where name='systemvm-xenserver-3.0.0' and removed is null"); 
-
89:	pstmt = conn.prepareStatement("select distinct(vm_template_id) from vm_instance where type <> 'USER' and hypervisor_type = 'XenServer'"); 
-
99:	pstmt = conn.prepareStatement("select id from vm_template where name='systemvm-kvm-3.0.0' and removed is null"); 
-
105:	pstmt = conn.prepareStatement("select distinct(vm_template_id) from vm_instance where type <> 'USER' and hypervisor_type = 'KVM'"); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: close, commit, rollback
95:	connection.commit(); 
-
98:	connection.rollback(); 
-
107:	connection.close(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: createStatement
43:	statement = conn.createStatement(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: prepareStatement, x 1
35:	PreparedStatement pstmt = conn.prepareStatement("SELECT value FROM `cloud`.`configuration` where name = 'usage.stats.job.aggregation.range'"); 
-
50:	pstmt = conn.prepareStatement("SELECT count(*) FROM `cloud_usage`.`cloud_usage` cu where usage_type not in (4,5) and raw_usage > "+aggregationHours+lastCheckId); 
-
65:	PreparedStatement pstmt = conn.prepareStatement("select count(*) from cloud_usage.cloud_usage cu inner join cloud.vm_instance vm where vm.type = 'User' " + 
-
77:	pstmt = conn.prepareStatement("select sum(cnt) from (select count(*) as cnt from cloud_usage.usage_vm_instance where usage_type =1 " + 
-
89:	pstmt = conn.prepareStatement("select sum(cnt) from (select count(*) as cnt from cloud_usage.usage_vm_instance where usage_type =2 " + 
-
101:	pstmt = conn.prepareStatement("select count(vm_instance_id) from cloud_usage.usage_vm_instance o where o.end_date is null and o.usage_type=1 and not exists " + 
-
117:	PreparedStatement pstmt = conn.prepareStatement("select count(*) from cloud_usage.cloud_usage cu inner join cloud.volumes v " + 
-
129:	pstmt = conn.prepareStatement("select sum(cnt) from (select count(*) as cnt from cloud_usage.usage_volume " + 
-
144:	PreparedStatement pstmt = conn.prepareStatement("select count(*) from cloud_usage.cloud_usage cu inner join cloud.template_zone_ref tzr " + 
-
159:	PreparedStatement pstmt = conn.prepareStatement("select count(*) from cloud_usage.cloud_usage cu inner join cloud.snapshots s " + 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: close
66:	conn.close(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: close, getAutoCommit, getTransactionIsolation, setAutoCommit, setTransactionIsolation
184:	if ((this.isolation != null) && (connection.getTransactionIsolation() != this.isolation.intValue())) { 
185:	connection.setTransactionIsolation (this.isolation.intValue()); 
-
189:	if ( connection.getAutoCommit() != this.autocommit ){ 
190:	connection.setAutoCommit(this.autocommit); 
-
196:	connection.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close, getAutoCommit, rollback, setAutoCommit
72:	autoCommit = conn.getAutoCommit(); 
73:	config.setThreadLocalConnection(conn); 
-
81:	if (conn != null) try {conn.rollback();} catch (Exception e1) {e1.printStackTrace();} 
-
88:	conn.setAutoCommit(autoCommit); 
89:	conn.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: createStatement
207:	stmt = _bootstrapConn.createStatement(); 
-
209:	DBHelper.commit(_bootstrapConn); 
-
212:	DBHelper.rollback(_bootstrapConn); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getAutoCommit, getTransactionIsolation, setTransactionIsolation
184:	if ((this.isolation != null) && (connection.getTransactionIsolation() != this.isolation.intValue())) { 
185:	connection.setTransactionIsolation (this.isolation.intValue()); 
-
189:	if ( connection.getAutoCommit() != this.autocommit ){ 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: commit, getAutoCommit, rollback, setAutoCommit
70:	oldAutocommit = connection.getAutoCommit(); 
71:	connection.setAutoCommit(false); 
-
73:	connection.commit(); 
-
81:	connection.rollback(); 
-
88:	connection.commit(); 
-
96:	connection.setAutoCommit(oldAutocommit); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close, createStatement, prepareStatement
47:	UnWrapper uw = DataSourceFinder.getUnWrapper(conn); 
-
49:	assertTrue(uw.canUnwrap(conn)); 
50:	Connection unwrapped = uw.unwrap(conn); 
-
54:	Statement st = conn.createStatement(); 
-
63:	PreparedStatement ps = conn.prepareStatement("select curtime()"); 
-
73:	conn.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: prepareStatement
20:	PreparedStatement pstmt = conn.prepareStatement(query); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: sleep, close, createStatement, getMetaData
75:	connection.getMetaData(); 
-
81:	Statement stmt = connection.createStatement(); 
-
118:	connection.close(); 
-
120:	Thread.sleep(100); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getAutoCommit, getCatalog, getHoldability, getTransactionIsolation, isReadOnly
53:	this.holdability          = connection.getHoldability(); 
54:	this.transactionIsolation = connection.getTransactionIsolation(); 
55:	this.isAutoCommit         = connection.getAutoCommit(); 
56:	this.isReadOnly           = connection.isReadOnly(); 
57:	this.catalog              = connection.getCatalog(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: commit, createStatement, prepareStatement
45:	conn.createStatement().execute(ddl); 
-
47:	PreparedStatement stmt = conn.prepareStatement(dml); 
-
50:	conn.commit(); 
-
58:	rs = conn.createStatement().executeQuery("SELECT reverse(pk) FROM REVERSE_TEST"); 
-
63:	PreparedStatement stmt = conn.prepareStatement("SELECT pk FROM REVERSE_TEST WHERE pk=reverse(?)"); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
78:	connection.close(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: createStatement
47:	statement = conn.createStatement(); 
-
52:	DatabaseCreator.fillParentTable(conn); 
53:	DatabaseCreator.fillSimpleTable3(conn); 
54:	DatabaseCreator.fillSimpleTable1(conn); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: createStatement
55:	Statement s = c.createStatement(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close, getAutoCommit, getTransactionIsolation
167:	con.close(); 
-
188:	this.defaultAutoCommit = con.getAutoCommit(); 
-
191:	this.defaultTransactionIsolation = con.getTransactionIsolation(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: createStatement
26:	statement = connection.createStatement(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
102:	connection.close(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: close
57:	con.close(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: createStatement
100:	stmt = conn.createStatement(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
37:	connection.close(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: createStatement
143:	Statement statement = connection.createStatement(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
26:	c.close(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: close
50:	connection.close(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: close
30:	conn.close(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: close
174:	this.underlyingConnection.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
38:	this.conn.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
22:	conn.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
51:	this.conn.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
30:	conn.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
110:	conn.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
41:	this.connection.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
76:	conn.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
82:	closeable.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
114:	conn.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
148:	conn.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
34:	connection.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
89:	connection.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
27:	con.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
211:	conn.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close
234:	arg0.close(); 
Full Snippet Info
7
CodeRank
Related Java 8 Connection Questions & Answers:
See Code Examples for Java 8 Connection Methods: