Beispiel #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
}
Beispiel #2
0
func SQLDisconnect(connectionHandle SQLHDBC) (ret SQLRETURN) {
	r := C.SQLDisconnect(C.SQLHDBC(connectionHandle))
	return SQLRETURN(r)
}