Exemple #1
0
func (conn *Connection) Close() *ODBCError {
	if conn.connected {
		ret := C.SQLDisconnect(C.SQLHDBC(conn.Dbc))
		if !Success(ret) {
			err := FormatError(C.SQL_HANDLE_DBC, conn.Dbc)
			return err
		}
		ret = C.SQLFreeHandle(C.SQL_HANDLE_DBC, conn.Dbc)
		if !Success(ret) {
			err := FormatError(C.SQL_HANDLE_DBC, conn.Dbc)
			return err
		}
		conn.connected = false
	}
	return nil
}
Exemple #2
0
func SQLFreeHandle(handleType SQLSMALLINT, handle SQLHANDLE) (ret SQLRETURN) {
	r := C.SQLFreeHandle(C.SQLSMALLINT(handleType), C.SQLHANDLE(handle))
	return SQLRETURN(r)
}
Exemple #3
0
func (stmt *Statement) free() {
	C.SQLFreeHandle(C.SQL_HANDLE_STMT, stmt.handle)
}